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
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
What does c value mean?
Explain what is output redirection?
Explain what are the __date__ and __time__ preprocessor commands?
What are enums in c?
What is wrong in this statement? scanf(“%d”,whatnumber);
What is merge sort in c?
Hi can anyone tell what is a start up code?
How do I determine whether a character is numeric, alphabetic, and so on?
What tq means in chat?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
Why is #define used?
How can I call fortran?
How can you tell whether two strings are the same?
What is the return type of sizeof?