EASY
HSSC Clerk
IMPORTANT
Earn 100

The main() function is always

50% studentsanswered this correctly

Important Questions on Programming in C/C++

MEDIUM
HSSC Clerk
IMPORTANT
Length of the string "correct" and "correct strings" are
EASY
HSSC Clerk
IMPORTANT

The purpose of the following program fragment,

b = s+b;

s=b-s;

b=b-s; where s, b are two integers, is to:

MEDIUM
HSSC Clerk
IMPORTANT
The value of an automatic variable that is declared but not initialized will be
MEDIUM
HSSC Clerk
IMPORTANT
If a global variable is of static storage class, then
HARD
HSSC Clerk
IMPORTANT

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.

HARD
HSSC Clerk
IMPORTANT

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

MEDIUM
HSSC Clerk
IMPORTANT
The storage class static can be used to
HARD
HSSC Clerk
IMPORTANT

An implementation of a queue Q, using two stacks S1 and S2is given below


void insert (Q, x) {
push (S1, x);
}
void delete (Q) {
if(stack-empty (S2)) then
if(stack-empty(S1)) then {
print ("Q is empty");
return;
}
else while(! (stack-empty (S1))) {
x=pop(S1);
push (S2, x);
}
x=pop(S2);
}
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?