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


Please Help Members By Posting Answers For Below Questions

What is operator precedence?

647


What is the difference between struct and union in C?

580


Explain how do you print only part of a string?

652


What is a structure in c language. how to initialise a structure in c?

611


while initialization of array why we use a[][2] why not a[2][]...?

1869






How to write a multi-statement macro?

629


What is a pragma?

672


Write a program to check palindrome number in c programming?

601


I have a varargs function which accepts a float parameter?

583


Is it acceptable to declare/define a variable in a c header?

688


Which is more efficient, a switch statement or an if else chain?

585


What is wrong with this initialization?

597


Implement bit Array in C.

678


What is bubble sort in c?

640


What is quick sort in c?

588