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
Are the variables argc and argv are local to main?
How can type-insensitive macros be created?
What is structure in c definition?
What is a built-in function in C?
Explain what is the advantage of a random access file?
Why c is procedure oriented?
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
What are type modifiers in c?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is omp_num_threads?
I came across some code that puts a (void) cast before each call to printf. Why?
What is wrong with this program statement?
What is 02d in c?
Can you add pointers together? Why would you?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above