O Level | January 2011 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)

1) ‘C’ Programming Language was developed and written by

A) Martin Richards

B) Dennis Ritchie

C) Ken Thompson

D) Herman Hellorith


B

Show Answer


2) Which of the following is false in ‘C’ Programming Language

A) Keywords can be used as variable names

B) Variable names can contain digits

C) Variable names do not contain blank spaces

D) Capital letters can be used in variable names.


A

Show Answer


3) What will be the output of the following ‘C’ program
 

main()
{
int a=5;
float b=5.0;
if(a==b)
printf(“a and b are equal”);
else
printf(“a and b are different”);
}

A) a and b are equal

B) a and b are different

C) Error

D) None of the above


A

Show Answer


4) What will be the output of the following ‘C’ program?
 

main()
{
int a=1;
int b=5;
if(a=5||b>10)
printf(“I will certainly pass”);
else
printf(“I am not so sure about the result”);
}

A) I will certainly pass

B) I am not so sure about the result

C) Error

D) None of the above


B

Show Answer


5) What will be the output of the following program?
 

main()
{
int a;
printf(“%d”,a);
}

A) 0

B) 1

C) Error

D) Unpredictable Value


D

Show Answer


6) A ‘C’ expression contains relational, assignment and arithmetic operators. There are no parentheses used. They will be evaluated in which of the following order

A) Assignment Relational Arithmetic

B) Arithmetic Relational Assignment

C) Relational Arithmetic Assignment

D) Assignment Arithmetic Relational


B

Show Answer


7) Prototype of function named ‘fun’ is: int fun(int a, float b) Which of the following is true about function ‘fun’:

A) It takes two inputs, one integer type and the other float type but returns nothing

B) It takes two inputs, one integer type and the other float type but returns 0

C) It takes two inputs, one integer type and the other float type but returns an integer

D) It takes two inputs, one integer type and the other integer type but returns float


C

Show Answer


8) What will happen if an element is assigned a value to an element of an array whose subscript exceeds the size of the array

A) It will not be allowed, but no error message will be generated

B) Compiler will generate an error message suggesting the same

C) The element will be assigned NULL VALUE.

D) Some other data may be overwritten


D

Show Answer


9) In the following ‘C’ code
 

{
FILE *f = fopen( fileName, "r");
fread(f);
if(????)
puts(“End of file reached”);
}
 

Which one of the following can replace the ???? in the code above to determine if the end of a file has been reached?

A) f == EOF

B) feof( f )

C) eof( f )

D) f == NULL


B

Show Answer


10) With every use of a memory allocation function, what function should be used to release allocated memory which is no longer needed?

A) unalloc()

B) Dropmem()

C) Dealloc()

D) free()


D

Show Answer


Exam Back Paper (Solved)


July 2013 | M4.3-R4 (Introduction to ICT Resources)


July 2013 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2013 | M2-R4 (Internet Technology and Web Design)


July 2013 | M1-R4 (IT Tools and Business Systems)


January 2013 | M4.3-R4 (Introduction to ICT Resources)


January 2013 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


January 2013 | M2-R4 (Internet Technology and Web Design)


January 2013 | M1-R4 (IT Tools and Business Systems)


July 2012 | M4.3-R4 (Introduction to ICT Resources)


July 2012 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2012 | M2-R4 (Internet Technology and Web Design)


July 2012 | M1-R4 (IT Tools and Business Systems)


January 2012 | M4.3-R4 (Introduction to ICT Resources)


January 2012 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


January 2012 | M2-R4 (Internet Technology and Web Design)


January 2012 | M1-R4 (IT Tools and Business Systems)


July 2011 | M4.3-R4 (Introduction to ICT Resources)


July 2011 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2011 | M2-R4 (Internet Technology and Web Design)


July 2011 | M1-R4 (IT Tools and Business Systems)


January 2011 | M4.3-R4 (Introduction to ICT Resources)


January 2011 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


January 2011 | M2-R4 (Internet Technology and Web Design)


January 2011 | M1-R4 (IT Tools and Business Systems)


July 2010 | M4.3-R4 (Introduction to ICT Resources)


July 2010 | M3-R4 (Prog. and Prob. Solving Through ‘C’ Language)


July 2010 | M2-R4 (Internet Technology and Web Design)


July 2010 | M1-R4 (IT Tools and Business Systems)