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
Explain what are compound statements?
how to construct a simulator keeping the logical boolean gates in c
Explain what is the difference between text files and binary files?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Is main is a keyword in c?
How to establish connection with oracle database software from c language?
What are the advantages of union?
How can I do peek and poke in c?
Why is c called "mother" language?
What is f'n in math?
What is the difference between typedef struct and struct?
What is structure in c explain with example?
Give differences between - new and malloc() , delete and free() ?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?