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


Please Help Members By Posting Answers For Below Questions

Can a file other than a .h file be included with #include?

680


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3117


In c language can we compile a program without main() function?

570


What are the two types of structure?

568


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

1423






How can I pad a string to a known length?

608


What is an lvalue?

627


What is dynamic variable in c?

559


What is 1d array in c?

597


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

725


a program that can input number of records and can view it again the record

1476


How can I call a function with an argument list built up at run time?

630


Find MAXIMUM of three distinct integers using a single C statement

622


What does %d do in c?

537


How many types of errors are there in c language? Explain

565