• No results found

C MCQ's

N/A
N/A
Protected

Academic year: 2021

Share "C MCQ's"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

C-

C- Object

Objectives

ives (

( Unit

Unit -1)SET

-1)SET-1

-1

1. Which of the following is not a valid variable name declaration? 1. Which of the following is not a valid variable name declaration? a)

a) int int _a3; _a3; b) b) int int a_3a_3;; c) c) int int 3_a3_a;; d) d) int int _3a_3a 2. All keywords in  are in

2. All keywords in  are in

a) LowerCase letters

a) LowerCase letters b) b) !""erase !""erase lettersletters c) c) CamelCase CamelCase letters letters d) d) NoneNone 3. Which of the following is not a valid  variable name?

3. Which of the following is not a valid  variable name? a)

a) int int n#mber; n#mber; b) b) float float rate;rate; c) int variable_count;c) int variable_count; dd) int $main;) int $main;

$.

$. %he format%he format identifier &'i( is also #sed for  identifier &'i( is also #sed for _____ data ty"e?_____ data ty"e? a) char

a) char b) intb) int c) floatc) float d) d) doubledouble . What is the si*e of

. What is the si*e of an int data ty"e?an int data ty"e? a)

a) $ $ +ytes +ytes b) b) , , +ytes+ytes cc) Depends on ) Depends on the system/compiler the system/compiler  d) d) annot annot be be determineddetermined -. Which of the following is not a valid variable name declaration?

-. Which of the following is not a valid variable name declaration? a)

a) float float / / 0 0 3.1$; 3.1$; b) b) do#ble do#ble / / 0 0 3.1$3.1$;; c) int PI = 3.!;c) int PI = 3.!; d) d) define define / / 3.1$3.1$ . Which is correct with res"ect to si*e

. Which is correct with res"ect to si*e of the dataty"es?of the dataty"es? a)

a) char char   int int   float float b) b) int int   char char   floatfloat c) char " int " do#blec) char " int " do#ble d) d) do#ble do#ble   char char   intint ,. Which keyword is #sed to "revent any changes in the variable within a  "rogram?

,. Which keyword is #sed to "revent any changes in the variable within a  "rogram? a)

a) imm#table imm#table b) b) m#tablem#table c) constc) const d) volatiled) volatile 4. A variable

4. A variable declared in a function can be used in declared in a function can be used in mainmain a) %r#e

a) %r#e b) alseb) alse c) c) %r#e %r#e if if it it is is declared declared staticstatic d) None of the mentionedd) None of the mentioned 15. Which

15. Which esca"e character esca"e character can be #sed to bee" from s"eaker in ?can be #sed to bee" from s"eaker in ?

%) &a

%) &a B) B) \b \b C) C) \m \m D) D) \n\n 11.

11. Explicit tpe conversionExplicit tpe conversion is !no"n as is !no"n as ... A) casting

A) casting B) B) conversion conversion C) C) dis#unction dis#unction D) D) separationseparation 12. If a is an integer variable, a=7/3; will return a value

12. If a is an integer variable, a=7/3; will return a value A)

A) 2.5 2.5 B) B) 3 3 C) C) 00 D) 2D) 2

13. ierar!"#$%&erat'r (re!een!e) e!ies w"i!" '&erat'r 13. ierar!"#$%&erat'r (re!een!e) e!ies w"i!" '&erat'r

$)

$) is *'st is *'st i*&'rtanti*&'rtant B) is used firstB) is used first C) is fastestC) is fastest +) %&erates 'n largest+) %&erates 'n largest nu*bers

nu*bers 1.

1. -"i!" 'f t"e f'll'wing is -"i!" 'f t"e f'll'wing is t"e !'rre!t 'rer 'f evaluati'n f'r t"e t"e !'rre!t 'rer 'f evaluati'n f'r t"e bel'w e&ressi'nbel'w e&ressi'n  =   #   /   2 4 1

 =   #   /   2 4 1 A.

A. * / % + - =* / % + - = B.B. = =   / /     4 4 C. C. / /     4 4   = = +.  +.    / / 4 4   == 15.

15. In w"i!" 'rer ' t"e f'll'wing gets evaluateIn w"i!" 'rer ' t"e f'll'wing gets evaluate 1.elat

1.elati'nal i'nal 2.Arit"*eti2.Arit"*eti! ! 3.6'gi!al 3.6'gi!al .. Assign*enAssign*entt A. 2134

(2)

C- Objectives (SET-2)

1. %hich of the follo"in& cannot be chec!ed in a s"itch'case statement(

$. Character

B.nte&er

C. Float

 

D.

enum

2. Ientif# t"e un!'niti'nal stru!ture 

1)'4w"ile 2)8wit!" 3)goto  )If  3)/dentify the wrong statement 6

1) if7ab); ') i( a  b ; c) if 7ab) 8 ;9 d)none $)%he minim#m n#mber of times d5:while loo" eec#ted is 6 1)5 ')  3)2 $) can not be "redicted ) What is the val#e of  in the e"ression  0 7a015 < a=a) 1)invalid 2) 5 3)15 !)**

-)%he &>( o"erator dis"lays 6

a)%ddress o( +ariable b)val#e of variable c)a and b both d)none )what f#nction is a""ro"riate for acce"ting a string

a),ets-) b)getch7) c)getche7) d)scanf7) ,)Which is the correct statement for finding c#be of 2.

a)pow-'3) b)"ow73<2) c)"ow7c) d)none

4)/n switch < character constants are a#tomatically converted to::::::::

a)floats b)inte,ers  c)do#ble

15) A single character in"#t from the keyboard can be obtained by #sing the f#nction. 7A) "rintf 7 ) 7+) scanf 7 ) 7) "#tchar 7 ) -D) ,etchar - )

11)%he variable that are declared o#tside all the f#nctions are called ______.

7A) ocal variable -) 0lobal +ariable 7) A#to variable 7@) one of the above 12)Which can not be #sed for m#lti"le conditions 6

a)1imple2i(  b)switch c) Blse if ladder d)nested:if  13)Cow many times loo" will be r#n 6 for7i015; ; i: :)

a)15 b)1 c)4 d)In(inite

1$)Which is an eit:controlled loo" 6

a)for b)while c)do d)none

1)%he contin#e command can not be #sed with 6

(3)

C- Objectives (SET-3)

1)"hat is the default return tpe of a function (

a)void

b)int

c)*oat

d)char

+),he pro&ram execution starts from

-a)function dened rst

b)main()

c)function dened last d)none

/)c lan&ua&e allo"s ar&uments to be passed 0

a)call b val

b)call b ref

c)both

 

c)none

)%hen main function is called 2 it is called "ith the ar&uments 0

a)ar&c

b)ar&v

c)none

)both

3)4eader le in c contains

-a)compiler commands

b)!ib"a"# $%nctions

c)4eader information

d)none

5)6unction "ithin another function is !no"n as -'

a)arra of function

b)neste $%nction

c)function prototpe

7)"hich t

ells compiler  abo#t n#mber of "arameters f#nction takes< data:ty"es of "arameters and ret#rn ty"e of f#nction 6

a)(#nction prototype b)calling f#nction c)called f#nction

,)A f#nction which is called by another f#nction is known as 6

a)nested f#nction b)calling f#nction c)called (#nction 4)A f#nction which calls another f#nction is known as 6

a)nested f#nction  b)callin, (#nction c)called f#nction 15)A f#nction which calls itself is known as 6

a)nested f#nction b)calling f#nction c)called f#nction d)rec#rsi+e (#nction 11)A "rocess in which a f#nction calls itself is known as 6

a)E#ltif#nction b)rec#rsion c)indirection d)"rototy"ing 12)An array which has more than one s#bscri"t is known as 6

(4)

13) A two dimensional array is also known as 6 a)Fector b)matri  c)string

1$)A matri which has more *ero elements is known as 6 a) #nit matri b)*ero matri c)sparse matri 1)Eembers of an array are accessed #sing GGGG.. a)val#es b)variable c) inde

1-) /nde of array starts from GG..

a) 4ero b)one c) :1

1) /f aH4I is an array of integers < how many val#es can it store ?

a) 4 b) * c)11 d),

1,)/f tableHIHI is an array < how many val#es can be stored by this array ?

a)12 b) c) d)35

14)if marksH$IH-I is an array < how many rows will it have ?

a) ! b)- c)2$ d)15

C- Objectives (SET-&)

J.1)Arrays are #sed to store elements of 6:

a)1ame type b) m#lti"le ty"e c)different ty"e d)none

J.2) Which of the following is a derived data ty"e 6:

a) ointer b)D#nction c)Array d)%ll

J.3)%he si*eof o"erator ret#rns the si*e of a data ty"e e"ressed in 6

a)bits b)nibbles c)words d)bytes

K.$)Which of the following is not an #nformatted console /LM f#nction 6

a)gets7) b)"#ts7) c)print(-) d)getch7)

K.) Which class is #sed to declare a variable as global in other "rogram 6 a)a#to b)register c)static d)etern

K.-) /n which storage class < the variable is not stored in main memory 6 a) a)a#to b)re,ister   c)static d)etern

(5)

K.) which o"erator is #sed for m#lti"le indirection 6

a) > b)66 c). d)

K.,)A variable which stores address of another variable is known as 6

a)pointer  b)static c)address of d)f#nction

K.4)Which o"erator is #sed for referencing 6:

a) '

b)8

c).

d)9

K.15)Which o"erator is #sed for dereferencing 6:

a) :

b)

c).

d)9

K.11)Which o"erator is known as address:of o"erator 6:

a) '

b)8

c).

d)9

K.12)Which o"erator is known as val#e:at :address o"erator 6:

a) :

b)

c).

d)9

K.13) Address of first member of array is known as 6

a) first address b)base address c)array address K.1$) an a "ointer "oints to itself ?

a) yes b)o

K.1) A "ointer which "oints to another "ointer is known as 6

a)m#lti"ointer  b)pointer2to2pointer  c)void "ointer  K.1-)which o"eration can not be "erformed between two "ointers ;

a) s#btraction b)addition  c)com"arison

K.1) A "ointer that can "oint at obNects of any data ty"e? a)#ll "ointer  b)+oid pointer  c)data "ointer  K.1,) A "ointer that "oints to nothingG.

a)7#ll pointer  b)void "ointer c)data "ointer  

K.14)Arg#ments given to main f#nction from command "rom"t are known as 6 a) s"ecial arg#ments b)command line ar,#ments

(6)

C- Objectives (SET-)

1)

%hich is a formatted le function (

a) f&ets) b)fputs) c)$scan$()

d)f&etc)

+)

"hich function is not used for text le (

a) $*"ite()

b)f&ets)

c)fscanf) d)fprintf)

3)which f#nction does set the c#rsor to the starting of a file ?

a)ftell7) b)rewind-) c)fseek7)

$) data can be accessed directly from which file ?

a) seK#ential b)random

) A collection of variable of different data ty"es is known as 6 a)array b)str#ct#re  c)"ointer

-) A f#nction which is #sed to create a tet file is GG..

a)(print(-) b)fscanf7)

8) or accessin, a str#ct#re element #sin, a pointeryo# m#st #se9 HaI@ot o"erators7.) HbIointer o"erator7=) :c%rrow operator-2) ,) Cow will yo# free the allocated memory ?

 A.remove7var:name); .(ree-+ar2name);

.delete7var:name); @.dalloc7var:name); 4)/n which data ty"e memory is shared by all members 6

a) <nion b)str#ct#re

15)/f the val#e is not assigned to variable < which will give a garbage val#e ?

a) static b)a#to c)etern

11)which variable is also known as local variable ?

a) a#to b)etern

12)which variable is also known as local variable ?

References

Related documents

Indira Nooyi, CEO PepsiCo Madras Christian College The non‐IIT Faces Satya Nadela, CEO Microsoft Manipal Institute of Technology Rakesh Kapoor, CEO Reckitt Benckiser BITS

All of the participants were faculty members, currently working in a higher education setting, teaching adapted physical activity / education courses and, finally, were

In this study, it is aimed to develop the Science Education Peer Comparison Scale (SEPCS) in order to measure the comparison of Science Education students'

By first analysing the image data in terms of the local image structures, such as lines or edges, and then controlling the filtering based on local information from the analysis

Therefore, based on the recommendation of the Audit Committee, the Supervisory Board approved the annual financial statements and the consolidated financial statements of Sky

In addition, time management, self-discipline, and teamwork (as the result of being a member of an athletic team) have been invaluable. ~ Michelle Kelly One of the

The theoretical basis of synchronous separation copper and iron component from copper smelting slag was to choose the appropriate oxygen and sulfur potential, which make the

When the alek duo has finished, the alek satu then continues the performance, answering and asking more questions about the issues presented by the indang supangka