
The main() function is always


Important Questions on Programming in C/C++

The purpose of the following program fragment,
b = s+b;
s=b-s;
b=b-s; where s, b are two integers, is to:



Which of the following about conditional compilations is not true?
1: It is taken care of by the computer.
2: It is setting the compiler option conditionally.
3: It is compiling a program based on a condition.
4: It is taken care of by the pre-processor.

For C preprocessor, which of the following is/are true?
1: Takes care of conditional compilation
2: Takes care of macros
3: Takes care of included files
4: Act before compilation


An implementation of a queue Q, using two stacks S and Sis given below
void insert (Q, x) {
push (S, x);
}
void delete (Q) {
if(stack-empty (S)) then
if(stack-empty(S)) then {
print ("Q is empty");
return;
}
else while(! (stack-empty (S))) {
x=pop(S);
push (S, x);
}
x=pop(S);
}
Let n insert and m(n) delete operations be performed in an arbitrary order on an empty queue Q. Let x and y be the number of push and pop operations performed respectively in the process. Which one of the following is true for all m and n?
