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
What are the header files used in c language?
What is a program flowchart and how does it help in writing a program?
What does %p mean?
What is #line used for?
What are the types of c language?
How does pointer work in c?
Explain the bubble sort algorithm.
What is an array? What the different types of arrays in c?
Explain what are bus errors, memory faults, and core dumps?
Explain how do you override a defined macro?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
i want to know the procedure of qualcomm for getting a job through offcampus
What is the scope of local variable in c?
Explain the properties of union. What is the size of a union variable