Thursday, January 29, 2009

You have the following line in a C program:

#include
and you compile the program.
Given the scenario described above, how is the line parsed?

Choice a : The linker resolves the symbols in stdio.h and links it with the overall program.

Choice b : The preprocessor creates pointers to stdio.h.

Choice c : The compiler creates lexically local variables definitions stored in stdio.h.

Choice d : The compiler allocates a name space for the symbols stored in stdio.h.

Choice e : The preprocessor replaces the line with the contents of stdio.h.

Monday, January 26, 2009

State o/p

#include
int main()
{
printf("%d",-16["WHAT A PLAYER WHAT A PLAYER SLUMDOG!!!"]);
return 0;
}
A. Error
B. GARBAGE
C. 65
D. none of the above

Wednesday, January 21, 2009

Find the correct output

void main()
{
char a[]=”rama”;
char b[]=a;
printf (“%d %s”, sizeof (b),b);
}

(a) 5 rama

(b) 4 rama

(c) 5 r

(d) None of these, some other reason

Monday, January 12, 2009

Which one of the following is an advantage of dynamically linked object files?

Choice a : Programs that use dynamic linking do not require recompiling when a new processor type is used.

Choice b : Dynamically linked programs contain all machine code required to run them.

Choice c : Dynamically linked programs use extended memory, but statically linked programs only have access to conventional memory.

Choice d : Programs that use dynamic linking can benefit from library updates without relinking.

Choice e : Dynamically linked programs run faster because debugging symbols are not included.

Saturday, January 10, 2009

Which one of the following is NOT a valid identifier?

Choice a: bigNumber
Choice b: peaceful_in_space
Choice c : auto
Choice d : __ident
Choice e : g42277

Thursday, January 8, 2009

Find the correct output

void main()
{

int a[]={‘a’,’b’,’c’};
printf(“%d”, sizeof(a));

}

(a) 3
(b) 4
(c) can’t be initialized
(d) None of these

Thursday, January 1, 2009

An expression contains relational, assignment and arithmetic operators. If Parenthesis are not present, the order will be

a. Assignment, arithmetic, relational
b. Relational, arithmetic, assignment
c. Assignment, relational, arithmetic
d. Arithmetic, relational, assignment