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
What is New modifiers?
What is the difference between ++a and a++?
What is a method in c?
What is multidimensional arrays
Explain what happens if you free a pointer twice?
Explain the difference between exit() and _exit() function?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
What is unary operator?
swap 2 numbers without using third variable?
How can you convert integers to binary or hexadecimal?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What are control structures? What are the different types?
What are header files? What are their uses?
using only #include