Vous êtes sur la page 1sur 4

SMT.

BHAGWATI CHATURVEDI COLLEGE OF ENGINEERING Spandan-2012 C-Coding & Debugging

Name: __________________________________

Roll No: ___________

Section: ____

(1) C programming language was developed by (A) Dennis Ritchie (B) Ken Thompson (C) Ken Thompson (D) Peter Norton (2) C is a ___ language (A) High Level (B) Low Level (C) Middle Level (D) Machine Level (3) What is the valid range of numbers for int type of data? (A) 0 to 256 (B) -32768 to +32767 (C) -65536 to +65536 (D) No specific range (4) An integer constant in C must have: (A) At least one digit (B) digit with decimal (C) both A & B (D) None of above (5) Which of the following symbol is used to denote a pre-processor statement? (A) ~ (B) # (C) ! (D) ;

(6) Find out the output for the following code main( ) { float a = 5, b = 2 ; int c ; c=a%b; printf ( "%d", c ) ; } (A) 2.5 (B) 1 (C) 2 (D) error

(7) Find out the output for the following code main( ) { int a = 300, b, c ; if ( a >= 400 ) b = 300 ; c = 200 ; printf ( "\n%d ", b ) ; }

(A) 300

(B) garbage

(C) 2

(D) error

8) Find out the output for the following code


main( ) { int x = 3, y = 5 ; if ( x == 3 ) printf ( "\n%d", x ) ; else printf ( "\n%d", y ) ; }

(A) 3

(B) 5

(C) x

(D) error

(9) Find out the output for the following code


main( ) { int i = 4, z = 12 ; if ( i = 5 || z > 50 ) printf ( "\nDean of students affairs" ) ; else printf ( "\nDosa" ) ; }

(A) Dean of student affairs

(B) Dosa

(C) infinite

(D) error

(10) Find out the output for the following code


main( ) { int p = 8, q = 20 ; if ( p == 5 && q > 5 ) printf ( "\nWhy not C" ) ; else printf ( "\nDefinitely C !" ) ; }

(A) Why not C

(B) Definitely C !

(C) 5

(D) error

(11) Find out the output for the following code


main( ) { int j ; while ( j <= 10 ) { printf ( "%d", j ) ; j=j+1; } }

(A) Blank screen

(B) Infinite

(C) 12345678910

(D) error

(12) Find out the output for the following code


main( ) { int x = 1 ; while ( x == 1 ) { x=x-1; printf ( "\n%d", x ) ; } }

(A) 0

(B)1

(C) infinite

(D) error

(13) Find out the output for the following code


main( ) { int x = 1 ; while ( x == 1 ) x=x-1; printf ( "\n%d", x ) ; }

(A) 1

(B)0

(C) warning

(D) error

(14) Find out the output for the following code


main( ) { int x = 4, y, z ; y=--x; z = x- - ; printf ( "\n%d %d %d", x, y, z ) ; }

(A) 3 3 2

(B)4 3 2

(C) 2 3 3

(D) error

(15) Find out the output for the following code


main( ) { int i = 10 ; while ( i = 20 ) printf ( "\nA computer buff!" ) ; }

(A) computer buff!

(B)infinite loop

(C) 10

(D) 20

(16) Find out the output for the following code

main( ) { int x = 4, y = 0, z ; while ( x >= 0 ) { if ( x == y ) break ; else printf ( %d %d, x, y ) ; x- - ; y++ ; }}

(A) 4021

(B)4031

(C) 1325

(D) error

(17) Find out the output for the following code


main( ) { int k, j = 2 ; switch ( k = j + 1 ) { case 0 : printf ( "\nTailor") ; case 1 : printf ( "\nTutor") ; case 2 : printf ( "\nTramp") ; default : printf ( "\nPure Simple Egghead!" ) ; }}

(A) Tailor

(B)Tytor

(C) Tramp

(D) Pure Simple Egghead!

(18) C programs are converted into machine language with the help of (A) An Editor (B) A compiler (19) C variable cannot start with (A) Alphabet (B) Number (C) Both A & B (D) None of the above (C) An operating system (D) None of the above

(20) If a is an integer variable, a = 5 / 2 ; will return a value (A) 2


Answer Sheet 1) _ _ _ _ _ 2) _ _ _ _ _ 3)_ _ _ _ _ 4) _ _ _ _ _ 5) _ _ _ _ _ 6)_ _ _ _ _ 7) _ _ _ _ _ 8)_ _ _ _ _ _ 9)_ _ _ _ _ _ 10)_ _ _ _ _

(B) 2.5

(C) 0

(D) None of the above

11)_ _ _ _ 12) _ _ _ _ 13)_ _ _ _ 14) _ _ _ _ 15) _ _ _ _ 1 6)_ _ _ _ 17) _ _ _ _ 18)_ _ _ _ _ 19)_ _ _ _ _ _ 20)_ _ _ _ _

Vous aimerez peut-être aussi