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

1.1 In the passage of text, individual words and punctuation marks are known as

A) Constants

B) Keywords

C) Operators

D) Tokens


D

Show Answer


1.2 Choose the option that contains only valid hexadecimal integers.

A) 0x9F, 0xbcd, 0x1

B) 037, 0xx, 01000

C) 0x561u, 0x9h, 0xdd

D) H9F, HFF, HAA


A

Show Answer


1.3 Which one of the following are not valid variable names in C?

A) float_int, keyword, A1

B) ANSI, ascii, cpu

C) valid, variable, name

D) None of the above


D

Show Answer


1.4 What is the output of the following code?
 

main()
{ static int num=8;
printf(“%d ”,num=num-2);
if(num!=0) main(); }

A) 8 6 4 2

B) Infinite output

C) 6 4 2 0

D) Invalid because main function can’t call itself.


C

Show Answer


1.5 What is the effect of the following code?


main() { int a[4] = {25, 16};
printf(“%d %d”, a[0] & a[1], a[1]|a[2]) ; }

A) 16 16

B) Syntax error because of invalid operator symbol

C) 25 16

D) Syntax error because of invalid array initialization


A

Show Answer


1.6 What will be the output of the following code?
 

main() { int c,d, *p1=&c,*p2=&d, x;
c =10,d =4;
x = –3* – *p2 / *p1 + 5;
printf(“%d ”,x);
}

A) 6

B) Invalid syntax because / * is used for comments.

C) 8

D) Invalid syntax because three binary operators can’t be together in an expression.


A

Show Answer


1.7 What is the output of the following code?
 

main(){ int a, b; a=b=4;
b=a++;
printf("%d %d %d %d", a++, --b, ++a, b--); }

A) 5 3 7 3

B) Syntax error

C) 5 4 5 3

D) 6 2 6 4


D

Show Answer


1.8 When we declare an array

A) Compiler declare array name itself as a constant pointer to base address

B) A continuous file is allocated to store the elements value

C) Index of elements is declared automatically

D) All elements are initialized to zero


A

Show Answer


1.9 The do…while looping statement

A) is executed only once if the condition is true.

B) is also known as entry-controlled loop.

C) is executed at least once if the condition is false.

D) is unconditional looping statement..


C

Show Answer


1.10 What will be the output of the following code?
 

struct { int si;
double d;
float *cp; } s ;
void main() {
printf(“%d, %d, %d”, sizeof(s.d), sizeof(s.cp), sizeof(s)); }

A) 4, 4, 12

B) 8, 2, 12

C) 10, 4, 16

D) 8, 4, 14


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)