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
Explain about C function prototype?
Explain what is the stack?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
Why array is used in c?
what is use of malloc and calloc?
What is a lvalue
Why clrscr is used after variable declaration?
What is extern variable in c with example?
Explain how can you tell whether a program was compiled using c versus c++?
what will be the output for the following main() { printf("hi" "hello"); }
write an algorithm to display a square matrix.
Write a program to print ASCII code for a given digit.
What does sizeof int return?
Explain enumerated types in c language?
Describe newline escape sequence with a sample program?