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
Can a file other than a .h file be included with #include?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
In c language can we compile a program without main() function?
What are the two types of structure?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
How can I pad a string to a known length?
What is an lvalue?
What is dynamic variable in c?
What is 1d array in c?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
a program that can input number of records and can view it again the record
How can I call a function with an argument list built up at run time?
Find MAXIMUM of three distinct integers using a single C statement
What does %d do in c?
How many types of errors are there in c language? Explain