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 sizeof return in c?
What is const keyword in c?
What are pointers? What are different types of pointers?
What is difference between scanf and gets?
What is the difference between c &c++?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
What does a pointer variable always consist of?
What is c system32 taskhostw exe?
Explain the use of 'auto' keyword
Why are algorithms important in c program?
Multiply an Integer Number by 2 Without Using Multiplication Operator
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
What is the use of a static variable in c?