52.write a “Hello World” program in “c” without using a
semicolon?
53.Give a method to count the number of ones in a 32 bit number?
54.write a program that print itself even if the source file
is deleted?
55.Given an unsigned integer, find if the number is power of 2?
Answer Posted / siva jyothi
53:
#include<stdio.h>
main()
{
unsigned int num;
int i=0;
while(num!=0)
{
if(num&1 == 1)
{
i++;
}
num>>=1;
}
printf("number of 1's is:%d\n",i);
}
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Tell us the use of fflush() function in c language?
How variables are declared in c?
Explain how can you restore a redirected standard stream?
What are linked lists in c?
What is dynamic variable in c?
What are the salient features of c languages?
List the different types of c tokens?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
What are keywords in c with examples?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
Where define directive used?
What is #define used for in c?
Why do we write return 0 in c?
Explain what is the purpose of "extern" keyword in a function declaration?
How can I make sure that my program is the only one accessing a file?