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

Tell us the use of fflush() function in c language?

635


How variables are declared in c?

569


Explain how can you restore a redirected standard stream?

588


What are linked lists in c?

648


What is dynamic variable in c?

562






What are the salient features of c languages?

622


List the different types of c tokens?

621


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

1654


What are keywords in c with examples?

601


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1625


Where define directive used?

603


What is #define used for in c?

609


Why do we write return 0 in c?

549


Explain what is the purpose of "extern" keyword in a function declaration?

616


How can I make sure that my program is the only one accessing a file?

676