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 / amogh
53.
'num' is 32 bit integer
count=0;
for(;num!=0;count++)
num&=num-1;
55.
if(num&(num -1) == 0)
printf("%d is power of 2",num);
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is operator precedence?
What is the difference between struct and union in C?
Explain how do you print only part of a string?
What is a structure in c language. how to initialise a structure in c?
while initialization of array why we use a[][2] why not a[2][]...?
How to write a multi-statement macro?
What is a pragma?
Write a program to check palindrome number in c programming?
I have a varargs function which accepts a float parameter?
Is it acceptable to declare/define a variable in a c header?
Which is more efficient, a switch statement or an if else chain?
What is wrong with this initialization?
Implement bit Array in C.
What is bubble sort in c?
What is quick sort in c?