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

Is printf a keyword?

951


Explain what is wrong with this program statement? Void = 10;

977


Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80

2826


What is a example of a variable?

748


What is hashing in c?

872


How #define works?

829


What is a good data structure to use for storing lines of text?

809


Tell me is null always defined as 0(zero)?

822


How do you determine whether to use a stream function or a low-level function?

891


List out few of the applications that make use of Multilinked Structures?

1702


Explain what are the different data types in c?

931


What is the use of bitwise operator?

869


Is c easy to learn?

726


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

885


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

1133