Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / g

54:
you can load the source file to memory at the beginning of
the run using mmap(), or using one of the countless methods
to read from file in C and storing the data in a string
array, then it won't matter if the file is deleted, you can
always re-create it using the data in the process memory.

53/55: answering 53 also answers 55.

53:
int checkBits(x){
numOfOnes=0;
do{
if((x%2)!=0)
{numOfOnes++;}
x=x/2;
}while (x!=0);

return numOfOnes;
}

55:
int checkPower(x){
if(checkBits(x)==1)
{return 1;}
else{return 0;}
}

Is This Answer Correct ?    18 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is null defined in c?

1154


Why do we use static in c?

1125


What does %c do in c?

989


Is flag a keyword in c?

1153


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1338


Explain how do you determine a file’s attributes?

1045


What are the different types of control structures?

1043


What does. int *x[](); means ?

1066


What is the purpose of ftell?

1079


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1153


What are the differences between Structures and Arrays?

1211


What is difference between stdio h and conio h?

1374


How do we print only part of a string in c?

1025


What is character set?

1168


What is static and auto variables in c?

1089