You are on page 1of 26

1/439

I fat w od i m e n s i o n a la r r a ya r r [ 4 ] [ 1 0 ](a na r r a yw i h4r o w sa n d1 0c o l u m s )i stb e p a s s e di naf u n c t i o n ,w h i c ho ft h ef o l l o w i n gw o u l db et h ev a l i dp a r a m e t e r si nt h e f u n c t i o nd e f i n a t i o n ?

fn(int arr[4][10]) fn(int arr[][10]) fn(int arr[4][]) none of the above Correct Ans : 1,2 2/439
W h a ti sf u n c t i o nt oc o n c a t e n a t et w os t r i n g s ?

strcmp() strcat() strstr() strcpy() Correct Ans : 2 3/439


W h i c hf u n c t i o nw i l ly o uu s et ow r i t eaf o r m a t t e do u t p u tt ot h ef i l e ?

fputc() fprintf() fwrite() fputs() Correct Ans : 2 4/439 What would be printed on the standard output as a result of the following code snipper?
m a i n ( ) { e n u m { r e d , g r e e n , b l u e = 0 , w h i t e } ; p r i n t f ( " % d% d% d% d " , r e d , g r e e n , b l u e , w h i t e ) ; r e t u r n0 ; }

Will result in compilaion error? 0123 0101

0101 0102 Correct Ans : 3 5/439


W h a th a p p e n sw h e nt h ec o n t i n u ek e y w o r di se n c o u n t e r e di nt h ef o rl o o p ?

control passes to the initialization of the loop control passes o the condition of the loop control passes to the beginning of the loop control passes to the change expression of the loop. Correct Ans : 4 6/439

W h i c hs t a n d a r df u n c t i o ni su s e dt oc l e a rt h em e m o r ya l l o c a t e db yt h em a l l o c ( ) f u n c t i o n ?

free()

calloc delete release Correct Ans : 1 7/439 Choose the correct answer from given options about the given source code in C Language :
# i n c l u d e < s t d i o . h > # d e f i n eC1/ /L i n e1 m a i n ( )

m a i n ( ) { i n ti = 1 , j = 2 ; s w i t c h ( i ) { c a s e1 : p r i n t f ( " G O O D " ) ; b r e a k ; c a s ej : / /L i n e2 p r i n t f ( " B A D " ) ; b r e a k ; c a s eC : / /L i n e3 p r i n t f ( "G o o db u tB a d " ) ; b r e a k ; } }

Compile time Error on Line 2: can't create case using variable value Compile time error on Line 3: can't use macro in the place of case declration Print on standard output : GOOD Print on standard output : GOOD but BAD Correct Ans : 1 8/439 What will be printed on the standard output as a result of the following code snippest?
v o i dm a i n ( ) { c h a ra r r [ ] = { ' R ' , ' A ' , ' M ' , \ 0 ' } ; p r i n t f ( " % d " , s t r l e n ( a r r ) ; }

0 1 3 4 Correct Ans : 3 9/439


G i v e nt h ef o l l o w i n ga r r a y i n ta [ 8 ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 0 } ; W h a tw o u l db et h eo u t p u to f p r i n t f ( " % d " , a [ 4 ] ) ;?

3 4 5 Compiler error. Correct Ans : 3 10/439


W h i c ho ft h ef o l l o w i n gs t a t e m e n t sa r ec o r r e c tf o rt h ek e y w o r dr e g i s t e r ?

It is a storage-class specifier It guarantees that the variable is kep in the CPU register for maximum speed. It requests that the variable be kept in the CPU register for maximum speed. It does not guarantee that variable value is kep in CPU regiser for maximum speed Correct Ans : 1,3,4 11/439
G i v e nt h ef o l l o w i n ga r r a y i n ta [ 2 ] [ 3 ] [ 4 ] ; W h a tw o u l db et h en u m b e ro fe l e m e n t si na r r a ya ?

24 22 20 12 Correct Ans : 1 12/439 What would be printed on the standard output as a result of the following code snipper?
# d e f i n em a x ( a , b ) ( ( a ) > ( b )? ( a ) : ( b ) ) m a i n ( ) { i n ta = 4 ; f l o a tb = 4 . 5 ; p r i n t f ( " % . 2 f \ n " , m a x ( a , b ) ) ; }

Results in compilation error undefined value 4.50, 4 Correct Ans : 3 13/439

T h ed e c l r a t i o ni n t* ( * p ) [ 1 0 ]i n d i c a t e st h a t:

p is an array of pointers to functions the return type of which is an integer p is a pointer to a function that returns a pointer to an integer p is a pointer to an array of integer pointers p is a pointer to a character string Correct Ans : 2

Correct Ans : 2 14/439


W h i c ho ft h ef o l l o w i n gi sn o tas t r i n gf u n c t i o n?

strlen() strcmp() strcpy() strcomp() Correct Ans : 4 15/439 What will be printed on the standard output as a result of the following code snippest?
v o i dm a i n ( ) { i n ta r r [ ] [ 2 ] = { 1 , 2 , 3 , 4 , 5 , 6 } ; p r i n t f ( " % d " , a r r [ 2 ] [ 1 ] ) ; }

2 4 5 6 Correct Ans : 4 16/439 What is the output of the following program?

m a i n ( ) { i n tu = 1 , v = 3 ; p r i n t f ( " % d% d " , u , v ) ; f u n c t ( & u , & v ) ; p r i n t f ( " % d% d " , u , v ) r e t u r n0 ; } v o i df u n c t ( i n t* p u ,i n t* p v ) { * p u = 0 ; * p v = 0 ; r e t u r n ; }

1313

1313 1311 1300 3131 Correct Ans : 3 17/439 What will happen when the following code is executed?
{ i n tn u m ; n u m = 0 ; d o { n u m ; p r i n t f ( " % d" , n u m ) ; n u m + + ; } w h i l e ( n u m > = 0 ) ; }

The loop will run infinitely The program will no enter the loop There will be a copilation error A runtime error will be reported Correct Ans : 1 18/439
W h i c hf u n c t i o nw i l ly o uu s et op o s i t i o nt h ef i l ep o i n t e ra tt h eb e g i n n i n go ft h e f i l e ?

rewind() fseek() fscanf() a or b Correct Ans : 2 19/439 What will be printed on the standard output as a result of the following code snippest?
m a i n ( ) { i n tn u m = 4 2 5 ; p r i n t f ( " % d " , p r i n t f ( % d " , n u m ) ) ; }

Will result in compilaion error? 4425 4253 none of the above Correct Ans : 3 20/439

20/439
W h i c hf u n c t i o na l l o c a t e sm e m o r ya n di n i t i a l i z e se l e m e n t st o0 ?

assign() calloc() malloc() allocate() Correct Ans : 2 21/439 What would be printed on the standard output as a result of the following code snipper?
m a i n ( ) { s i g n e dc h a ri = 1 ; f o r ( ; i < = 2 5 5 ; i + + ) p r i n t f ( " % d " , j ) ; r e t u r n0 ; }

copilation error 1 2 3 .255 1 2 3 127 1 2 3..127-1280 1 2 3.(infinite times) Correct Ans : 4 22/439

W h i c ho ft h ef o l l o w i n gi sn o tav a l i dm o d ef o ro p e n i n gaf i l e ?

r a r+ i Correct Ans : 4 23/439


W h a tw i l lh a p p e ni fy o ua s s i g nav a l u et oa ne l e m e n to fa na r r a yt h es u b s c r i p to f w h i c he x c e e d st h es i z eo ft h ea r r a y ?

The element will be set to 0 Nothing ; it is commonly done it is undefined behaviour you will get an error message from the compiler Correct Ans : 2 24/439
W h a ti st h er e t u r nt y p eo ft h ef o l l o w i n gf u n c t i o nd e c l r a t i o n ? F u n c ( c h a rc ) ;

void char int undefined Correct Ans : 3 25/439


W h i c ho ft h ef o l l o w i n gi sn o tar e l a t i o n a lo p e r a t o r ?

== != <> >= Correct Ans : 3 26/439 What would be printed on the standard output as a result of the following code snipper?
m a i n ( ) { c h a ro p t i o n = 5 ; s w i t c h ( o p t i o n ) { c a s e' 5 ' : p r i n t f ( " c a s e1 " ) ; b r e a k ; c a s e5 : p r i n t f ( " c a s e2 " ) ; b r e a k ; d e f a u l t : p r i n t f ( " c a s e3 : " ) ; b r e a k ; } r e t u r n0 ; }

case 1

case 2 case 3 none of the above Correct Ans : 2 27/439


G i v e na na r r a y i n tn u m [ 3 ] [ 4 ] = { { 3 , 6 , 9 , 1 2 } , { 1 5 , 2 5 , 3 0 , 3 5 } , { 6 6 , 7 7 , 8 8 , 9 9 } } ; W h a tw o u l db et h eo u t p u to f* ( * ( n u m + 1 ) + 1 ) + 1 ?

3 15 26 66 Correct Ans : 3 28/439

W h a td o e st h ef o l l o w i n gf u n c t i o nd o ? i n tf n ( u n s i g n e di n tx ) { i n tc o u n t = 0 ; f o r ( ; x ! = 0 , x & = ( x 1 ) ) c o u n t + + ; r e t u r nc o u n t ; }

Returns the minimum number of bits required to represent the number x Returns the number of zero bits present in the number x Returns the number of 1 bits in the number x Returns the square root of the number Correct Ans : 3 29/439
I no r d e rt or e a ds t r u c t u r e s / r e c o r d sf r o maf i l e ,w h i c hf u n c t i o nw i l ly o uu s e ?

fscanf()

fread() fgets() fgetc() Correct Ans : 2 30/439


# i n c l u d e < s t d i o . h > i n ti = 4 0 ; e x t e r ni n ti ; i n tm a i n ( ) { d o { p r i n t f ( " % d " , i + + ) ; } w h i l e ( 5 , 4 , 3 , 2 , 1 , 0 ) ; r e t u r n0 ; }

40 41 40 41 42 43 44 . Infinite Error in do-while loop syntax Correct Ans : 1 31/439

W h i c ho ft h ef o l l o w i n gs t a t e m e n t sw i l lr e s u l ti nac o m p i l a t i o ne r r o r ?

int n=5, x; x=n++; int n=5,x; x=++n++; int n=5,x; x=(n+1)++; int n=5, x=6; x=(n+x)++ Correct Ans : 2,3,4 32/439
# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n ti = 1 ; f o r ( i = 0 ; i = 1 ; i = 1 ){ p r i n t f ( " % d" , i ) ; i f ( i ! = 1 )b r e a k ; } r e t u r n0 ; }

0 1 -1 compile time error in : conditional part of loop

compile time error in : conditional part of loop Correct Ans : 3 33/439


W h a td o e st h ea r g v [ 0 ]r e p r e s e n t ?

The first command line parameter has been passed to the program The program name The number of command line parameters None of the Above a static array hold arg information Correct Ans : 2 34/439

# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n ti ; f o r ( i = 0 ; i < = 5 ; i + + ) ; p r i n t f ( " % d " , i ) r e t u r n0 ; }

012345 01234 6 syntax error in for loop Correct Ans : 3 35/439


# i n c l u d e < s t d i o . h > i n tr ( ) ; i n tm a i n ( ) { f o r ( r ( ) ; r ( ) ; r ( ) ){ p r i n t f ( " % d" , r ( ) ) ; } r e t u r n0 ; } i n tr ( ) { i n ts t a t i cn u m = 7 ; r e t u r nn u m ; }

521 752

752 52 compile time error in : conditional part of loop Correct Ans : 3 36/439
W h a tw o u l db ep r i n t e do nt h es t a n d a r do u t p u ta sar e s u l to ft h ef o l l o w i n gc o d e s n i p p e s t ? m a i n ( ) { i n tn = 5 , x ; x = n + + ; p r i n t ( " % d " , x ) ; x = + + n ; p r i n t f ( " % d " , x + + ) ; p r i n t f ( " % d " , x ) ; r e t u r n0 ; }

678 578 688 None of the Above Correct Ans : 2 37/439


W h a tw o u l db ep r i n t e do nt h es t a n d a r do u t p u ta sar e s u l to ft h ef o l l o w i n gc o d e s n i p p e s t ? v o i df u n ( ) { s t a t i ci n ti = 1 ; i n tj = 1 ; i + + ; j + + ; p r i n t f ( " % d% d " , i , j ) ; } v o i dm a i n ( ) { f u n ( ) ; f u n ( ) ; f u n ( ) ; }

222222 223242 222324 None of the Above Correct Ans : 2 38/439


W h i c ho ft h ef o l l o w i n gs e t so fc o n v e r s i o ns t a t e m e n t sm a yr e s u l ti nt h el o s so f d a t a?

d a t a?

int i; char c; i=c; c=i; int i; char c; c=i; i=c; int i; float f; i=f; f=i; None of the Above Correct Ans : 2,3 39/439
# i n c l u d e < s t d i o . h > i n tm a i n ( ) { f o r ( ; ; ){ p r i n t f ( " % d" , 1 0 ) ; } r e t u r n0 ; }

10 10 10 10 .. Infinite time It will not print anything on the screen syntax error in for loop Correct Ans : 2 40/439
W h a ti so u t p u to ff o l l o w i n gp r o g r a mw h e nw ec o m p i l ea n dr u ni t ? v o i dm a i n ( ) { i n t c o n s t*p = 5 ; p r i n t f ( " % d " , + + ( * p ) ) ; }

print 6 on standard output Compile time error in pointer declration Can't Say (Pointer dangling) None of the above Correct Ans : 2 41/439
W h a ti so u t p u to ff o l l o w i n g v o i dm a i n ( ) { c h a rc h ; f o r ( c h = 0 ; c h < = 1 2 7 ; c h + + ) p r i n t f ( " % c % d\ n " ,c h ,c h ) ; }

Compile time Error because : Can't apply ++ on char data type Will print 128 characters with corresponding ASCII code Loop execute infinite

Loop execute infinite None Correct Ans : 2 42/439

W h a ti so u t p u to ff o l l o w i n g ? m a i n ( ) { c h a rs [ ] = " m a n " ; i n ti ; f o r ( i = 0 ; s [ i ] ; i + + ) p r i n t f ( " \ n% c% c% c% c " , s [ i ] , * ( s + i ) , * ( i + s ) , i [ s ] ) ; }

Error in printf statement : i[s] is not valid, you can't put array name in subscript Print the following output : man man man man Print ouptut : m m m m a a a a n n n n None of the above Correct Ans : 3 43/439
W h a ti so u t p u to ff o l l o w i n g ? ? m a i n ( ) { f l o a tf 1=1 . 0 ; d o u b l ef 2=1 . 0 ; i f ( f 1 = = f 2 ) p r i n t f ( " Il o v eU " ) ; e l s e p r i n t f ( " Ih a t eU " ) ; }

Print : I love U Print : I hate U _ _ Correct Ans : 1

Correct Ans : 1 44/439


W h a ti so u t p u to ff o l l o w i n g m a i n ( ) { c h a ra [ 4 ] = " H E L L O " ; p r i n t f ( " % s " , a ) ; }

Print : HELLO Print only : H Error in printing Error in String initialization Correct Ans : 4 45/439
W h a ti so u t p u to ff o l l o w i n g ? m a i n ( ) { i n ta = 1 0 , * j ; v o i d* k ; j = k = & a ; / /L i n e: 1 j + + ; k + + ; / /L i n e:2 p r i n t f ( " \ n% u% u" , j , k ) ; }

Error on Line 1 : can't assign value from k to j Error on Line 2: can't apply ++ unary operator on void * pointer Print the same value for both k & j None of the above Correct Ans : 3 46/439
W h a tv a l u e sa r ep r i n t e dw h e nw er u nf o l l o w i n g ?

m a i n ( ) { s t a t i ci n tv a r=5 ; p r i n t f ( " % d" , v a r ) ; i f ( v a r ) m a i n ( ) ; }

54321 543210 5 5 5 5 .. Infinite Error in if statement : condition required

Correct Ans : 1 47/439

W h a tw i l lb et h eo u t p u to ft h ef o l l o w i n gp r o g r a mw h e ny o ue x e c u t ei t ? m a i n ( ) { i n tc [] = { 2 . 8 , 3 . 4 , 4 , 6 . 7 , 5 } ; / /L i n e1 i n tj , * p = c , * q = c ; / /L i n e2 f o r ( j = 0 ; j < 5 ; j + + ) { p r i n t f ( "% d" , * c ) ; + + q ; } f o r ( j = 0 ; j < 5 ; j + + ) { p r i n t f ( "% d" , * p ) ; + + p ; } }

Output will be : 2 2 2 2 2 2 3 4 5 7 Error on Line 1: can't copy or assign int[] array to pointer Output will be : 2 3 4 5 6 7 2 3 4 5 6 7 Error on Line 1: Can't initialize int type of array with double type of literal in braces data set. Correct Ans : 1 48/439
m a i n ( ) { i n ti = 1 , j = 1 , k = 0 , l = 2 , a ; a = i + + & & j + + & & k + + | | l + + ; p r i n t f ( " % d% d% d% d% d " , i , j , k , l , a ) ; }

0 -1 2 1 3 00131 Error in expression assigned to a on Line 1 Output : -1, -1, 0, 3, 4, Correct Ans : 2 49/439 What will be printed on the standard output as a result of the following code snippest?

v o i df u n 1 ( c h a rs [ ] ) { p r i n t f ( " % d " , s i z e o f ( s ) ) ; } v o i df u n 2 ( c h a r* s ) { p r i n t f ( " % d " , s i z e o f ( s ) ) ; } v o i dm a i n ( ) { c h a rs t r [ 1 0 ] = " H e l l o " ; p r i n t f ( "% d" , s i z e o f ( s t r ) ) ; f u n 1 ( s t r ) ; f u n 2 ( s t r ) ; }

10 10 2 10 2 2 10 2 10 10 10 10 Correct Ans : 2 50/439 What will be printed on the standard output as a result of the following code snippest?
m a i n ( ) { i n ti = 1 ; w h i l e( i < = 5 ) { p r i n t f ( " % d " , i ) ; i f( i > 2 ) g o t oh e r e ; i + + ; } } f u n ( ) { h e r e : p r i n t f ( " P P " ) ; }

1 2 3 PP 4 PP 5 PP 1 2 3 4 5 PP PP PP PP PP Compile time error in program : Undefined label here : Compiler Error : Can't transfer label control using goto outside function. Correct Ans : 3 51/439

51/439

# i n c l u d e < s t d i o . h > i n tm a i n ( ) { s t a t i ci n ti ; f o r ( + + i ; + + i ; + + i ){ p r i n t f ( " % d" , i ) ; i f ( i = = 4 )b r e a k ; } r e t u r n0 ; }

2 24 Compile time error None of the above Correct Ans : 2 52/439


# i n c l u d e < s t d i o . h > i n tm a i n ( ) { s t a t i ci n ti ; f o r ( + + i ; + + i ; + + i ){ p r i n t f ( " % d" , i ) ; i f ( i = = 4 )b r e a k ; } r e t u r n0 ; }

Compile time error Warning : possibly incorrect assignment in if statement 2 24 Correct Ans : 2,3 53/439
# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n ti , j ; i = j = 2 , 3 ; w h i l e ( i & & j + + ) p r i n t f ( " % d% d " , i , j ) ; r e t u r n0 ; }

12 13 will not print anything print value of i & j infinite Correct Ans : 2

Correct Ans : 2 54/439


# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n ti , j ; i = j = 2 , 3 ; p r i n t f ( " % d% d " , i , j ) ; }

23 22 33 None of the above Correct Ans : 2 55/439


# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n tx = 0 1 1 , i ; f o r ( i = 0 ; i < x ; i + = 3 ) { p r i n t f ( " S t a r t" ) ; c o n t i n u e ; p r i n t f ( " E n d " ) ; } r e t u r n0 ; }

Start End Start Start Start Start Start Start Start it will print anything on the screen Correct Ans : 2 56/439 What will be the output of following code when execute ?
# d e f i n eC U B E ( x )( x * x * x ) # d e f i n eM5 # d e f i n eNM + 1 # d e f i n eP R I N Tp r i n ( " H . G y a n " ) ; v o i dm a i n ( ) { i n tv o l u m e= C U B E ( 3 + 2 ) ; c l r s c r ( ) ; p r i n t f ( " % d% d" , v o l u m e , N ) ; P R I N T g e t c h ( ) ; }

125 6 H. Gyan 17 6 H. Gyan 125 5 H. Gyan None of the above Correct Ans : 2

57/439
# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n ti = 2 , j = 2 ; w h i l e ( i + 1 ? i : j + + ) p r i n t f ( " % d " , i ) ; r e t u r n0 ; }

1 0 -1 1 210 None of the above Correct Ans : 2 58/439


# i n c l u d e < s t d i o . h > i n tm a i n ( ) { e x t e r ni n tx ; d o { d o { p r i n t f ( " % o " , x ) ; } w h i l e ( ! 2 ) ; } w h i l e ( 0 ) ; r e t u r n0 ; } i n tx = 8 ;

8 10 Compile time error : None of the above Correct Ans : 2 59/439


# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { i n ta = 3 , b = 2 ; a = a = = b = = 0 ; s w i t c h ( 1 ) { a = a + 1 0 ; } s i z e o f ( a + + ) ; p r i n t f ( " % d " , a ) ; }

10 11 12 1

Correct Ans : 4 60/439


# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { i n ta = 3 , b = 2 ; a = a = = b = = 0 ; s w i t c h ( 1 ) { a = a + 1 0 ; } p r i n t f ( " % d " , a ) ; }

10 11 12 1 Correct Ans : 4 61/439


# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { i n ta = 5 ; a = a > = 4 ; s w i t c h ( 2 ) { c a s e0 : i n ta = 8 ; c a s e1 : i n ta = 1 0 ; c a s e2 : + + a ; c a s e3 : p r i n t f ( " % d " , a ) ; } }

Compile time error : Multiple declration of a 8 2 None of the above Correct Ans : 1 62/439
# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { s w i t c h ( 2 ) { c a s e1 L : p r i n t f ( " N o " ) ; c a s e2 L : p r i n t f ( " % s " , " I " ) ; g o t oL o v e ; c a s e3 L : p r i n t f ( " P l e a s e " ) ; c a s e4 L : L o v e : p r i n t f ( " H i " ) ; } }

I IPleaseHi IHi

Compilation error Correct Ans : 3 63/439


# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { c h a r* s t r = " w w w . g v c j a i p u r . c o . i n " ; i n ta = 2 ; s w i t c h ( ' A ' ) { c a s e9 7 : s w i t c h ( 9 7 ) { d e f a u l t :s t r + = 1 ; } c a s e6 5 : s w i t c h ( 9 7 ) { c a s e' A ' : s t r + = 2 ; c a s e' a ' : s t r + = 4 ; } d e f a u l t : f o r ( ; a ; a ) s t r + = 8 ; } p r i n t f ( " % s " , s t r ) ; }

www.gvcjaipur.co.in Compile time error : nested switch is not allowed Compile time error : loop can't be inside switch case None of the above Correct Ans : 1 64/439
# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { s t a t i ci n ti ; i n tj ; f o r ( j = 0 ; j < = 5 ; j + = 2 ) s w i t c h ( j ) { c a s e1 :i + + ; b r e a k ; c a s e2 :i + = 2 ; c a s e4 :i % = 2 ; j = 1 ; c o n t i n u e ; d e f a u l t :i ; c o n t i n u e ; } p r i n t f ( " % d " , i ) ; }

0 1 compilation errror None of the above Correct Ans : 1 65/439

# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { s t a t i ci n ti ; i n tj = 1 ; i n ta r r [ 5 ] = { 1 , 2 , 3 , 4 } ; s w i t c h ( a r r [ j ] ) { c a s e1 :i + + ; b r e a k ; c a s e2 :i + = 2 ; j = 3 ; c o n t i n u e ;/ /L i n e# 1 c a s e3 :i % = 2 ; j = 4 ; c o n t i n u e ; d e f a u l t :i ; } p r i n t f ( " % d " , i ) ; }

Compile time error on Line #1 : misplaced continue; It will print garbadge value , because i is not initlized 0 6 Correct Ans : 1 66/439
# i n c l u d e < s t d i o . h > # d e f i n eT R U E1 v o i dm a i n ( ) { s w i t c h ( T R U E ) { p r i n t f ( " w w w . g v c j a i p u r . c o . i n " ) ; } }

Compiler Error : at least one case required in switch control It will print nothing on console print : www.gvcjaipur.co.in None of the above Correct Ans : 2 67/439
# i n c l u d e < s t d i o . h > v o i dm a i n ( ) { u n s i g n e dc h a rc = 2 8 0 ; s w i t c h ( c ) { p r i n t f ( " S t a r t \ t " ) ; / /L i n e# 1 c a s e2 8 0 : p r i n t f ( " A " ) ; c a s e2 4 :p r i n t f ( " B " ) ; d e f a u l t : p r i n t f ( " C " ) ; p r i n t f ( " E n d " ) ; } }

Will Print : B C End Compile time error on Line #1 Compiler will show warning message on Line#1 : unreachable code Start B C End Correct Ans : 1,3 68/439
# i n c l u d e < s t d i o . h > i n tm a i n ( ) { i n ti = 5 ; i n ta = + + i++ + i++ + i ; p r i n t f ( " % d " , a ) ; r e t u r n0 ; }

24 22 21 20 Correct Ans : 1 69/439


W h i c ho ft h ef o l l o w i n gs t a t e m e n t ss h o u l db eu s e dt oo b t a i nar e m a i n d e ra f t e r d i v i d i n g3 . 1 4b y2 . 1?

rem = 3.14 % 2.1; rem = modf(3.14, 2.1); rem = fmod(3.14, 2.1); Remainder can't be obtain in floating point values Correct Ans : 3 70/439
W h i c ho ft h ef o l l o w i n gs p e c i a ls y m b o la l l o w e di nav a r i a b l en a m e ?

* (asterisk) | (pipeline) - (hyphen) _ (underscore) Correct Ans : 4

71/439
B yd e f a u l tar e a ln u m b e ri st r e a t e da sa

float double long double far double Correct Ans : 2 72/439


I st h ef o l l o w i n gs t a t e m e n tad e c l a r a t i o no rd e f i n i t i o n ? e x t e r ni n ti ;

Declaration Definition Function Error Correct Ans : 1 73/439


I d e n t i f yw h i c ho ft h ef o l l o w i n ga r ed e c l a r a t i o n s 1:e x t e r ni n tx ; 2:f l o a ts q u a r e(f l o a tx){. . .} 3:d o u b l ep o w ( d o u b l e ,d o u b l e ) ;

1 1 and 3 1 and 2 2 Correct Ans : 2 74/439 In the following program where is the variable a getting defined and where it is getting declared?

# i n c l u d e < s t d i o . h > i n tm a i n ( ) { e x t e r ni n ta ; p r i n t f ( " % d \ n " ,a ) ; r e t u r n0 ; } i n ta = 2 0 ;

extern int a is declaration, int a = 20 is the definition int a = 20 is declaration, extern int a is the definition int a = 20 is definition, a is not defined a is declared, a is not defined Correct Ans : 1 75/439
W h e nw em e n t i o nt h ep r o t o t y p eo faf u n c t i o n ?

Defining Declaring Prototyping Calling Correct Ans : 2,3 76/439


W h a ta r et h ed i f f e r e n tt y p e so fr e a ld a t at y p ei nC?

float, double short int, double, long int float, double, long double double, long int, float Correct Ans : 1 77/439
W h i c hs t a t e m e n tw i l ly o ua d di nt h ef o l l o w i n gp r o g r a mt ow o r ki tc o r r e c t l y ? # i n c l u d e < s t d i o . h > / /a d ds t a t e m e n th e r eL i n e:2 i n tm a i n ( ) { p r i n t f ( " % f \ n " ,l o g ( 3 6 . 0 ) ) ; r e t u r n0 ; #include "dos.h" }

#include"math.h" #include"dos.h"

#include"stdlib.h" Correct Ans : 2 78/439

You might also like