• No results found

Mcq

N/A
N/A
Protected

Academic year: 2021

Share "Mcq"

Copied!
80
0
0

Loading.... (view fulltext now)

Full text

(1)

2.Which of the following array initialization statements is valid? a.int ary{}={1,2,3,4}; b.int ary[] =[1,2,3,4]; c.int ary[] ={1,2,3,4}; d.int ary{4}=[1,2,3,4]; Ans=c

3.Which of the following statements assign the value stored in x to the first element on an array,ary? a.ary=x; b.ary=x[0]; c.ary=x[1]; d.ary[0]=x; Ans=d

6C language has been developed by A) Ken Thomson

B) Dennis Ritchie C) Peter Norton D) Martin Richards Ans:B

7C language has been developed at A) Microsoft corporation,USA B) AT & T Bell labs,USA C) Borland International,USA D) IBM,USA

Ans:B

8.C language came into existence in the year A)1971 B)1957 C)1972 D)1983 Ans:C 9.C is a

A) Middle level language B) High level language C) Low level language D) None of the above Ans:D

10.A DO WHILE LOOP IS USEFUL WHEN WE WANT THAT THE STATEMENTS WITHIN THE LOOP MUST BE EXECUTED

A) Only once B) At least once C) More than once D) None of the above Ans:B

11. A character variable can store at a time A) 1 character

(2)

B) 8 character C) 254 characters D) None of the above Ans=B

12. The break statement is used to exit from A) if statement

B) for loop C) a programme D) the main function Ans=B

13.The program execution starts from (a) The function which is first defined (b) Main ( ) function

(c) The function which is last defined (d) The function other than main( ) ANS= b

14.How many main ( ) functions can be defined in a C program (a) 1

(b) 2 (c) 3

(d) Any no. of times ANS=1

15.A character variable can at a time store (a) 1 character

(b) 8 character (c) 254 character (d) None of the above ANS=b

16.The maximum value that an integer constants can have is (a) -32767

(b) 32767 (c) 1.7014e+38 (d) -1.7014e+38 Ans =b

17.A function is defined by an open parenthesis foll a. a keyword

b. an identifier other than keywords. c. An identifier including keywords. d. An operator

Ans= b

18.C language has been developed by 1. ken Thompson.

2. Dennis Ritchie. 3. Peter Norton.

(3)

4. Martin Richards. Ans=2

19.A function is identified by an open paraenthsis. 1. a keyword.

2. an identifier other than keyword. 3. an identifier including keyeords. 4. an operator.

Ans=2

20.Find out the outpt Void main() { int a=”%d” Printf(“%d”); } 1.%d 2. 25637 3.37 4. % Ans =1 21.C is a

1. Middle level language. 2. high level language. 3. low level language. 4. none of these. Ans =4

22.a character variable can at a time store. 1. 1

2. 8 3. 254

4. none of the above. Ans=2

23.C language has been developed by a] Ken Thomspon b] Dennis Ritche c] Martin Richard d] Nats Thomson Ans-b 24.C can be used on a] Ms-Dos OS b] Linux OS c] Windows d] All Of Above Ans-d

(4)

25.A character variable can at a time store a] 1 b] 8 c] 256 d] 1024 Ans-a

26.C programs converted into machine language with the help of a] editor

b] compiler

c] operating system d] none of above

Ans-b

27.In C a variable cannot contain a] blank spaces

b] hypen c] decimal point d] all of above

Ans-d

28. C programme are converted into machine level language with the help of A) an interpreter

B) a compiler

C) an operating system D) none of the above Ans=B

29.A header file is a file

A) that contains standard library functions B) that contains definations and macros C) that contains user definer functions

D) that is present in current working dictionary Ans=C

30. what will be the output of programme? main();

{ int i;

for(i=1;i<=5;printf(“\n%d”,i)); i++;

(5)

} A) 51234 B) 12345 C) 35241 D) 54321 Ans=B

31.WHICH ERROR IS DISPLAYED IF ‘;’IS MISSING? a)Declaration error

b)Statement missing c)None of these d)No error Ans-b

32.Sqrt funcyion is included in which library? a)stdio.h

b)conio.h c)math.h d)none of these Ans-c

33.C language came into existence in a)1972

b)1865 c)1975 d)1986 Ans-a

34.Which is the format specifier for integer a)%s

b)%d c)%f d)%c Ans-b

35.A integer at 1 time can store? a)2 bytes

b)4 bytes c)8 bytes d)32 bytes Ans-a

36) which of the following is librarian ? A)printf]

(6)

c)#include<stdio.h> d)while

ans- c

37)the function used to take input from keyboard is a)scanf b)printf c)if else d)getch ans-a 38)float is denoted by a)%d b)%f c)%d d)%a ans-b

39)which of the following is format specifier a)if else

b)while c)int d)scanf ans-c

40)the function used to print the message or value content a)printf b)scanf c)while d)for ans-a

41.C language has been developed by a.Ken Thomson

b.Dennis Ritchie c.Peter Norton d.Martin Richards ans.Dennis Ritchie

42.C languages are converted to machine language with the help of a.an editor

b.a compiler

(7)

d.none

ans.a compiler

43. A character variable can at a time store a.1 character

b.8 characters c.254 characters d.none

ans.1 character

44.The maximum eange that an integer constant can have is a.-32767

b.32767 c.1.7014e+38 d.none ans.32767

45.a C variable cannot start with a.an alphabet

b.a number

c.a special symbol other than underscore d.both b and c above

ans, d. both b and c above.

46.C language has been developed by a.Ken Thomson

b.Dennis Ritchie c.Peter Norton d.Martin Richards ans.Dennis Ritchie

47.C languages are converted to machine language with the help of a.an editor

b.a compiler

c.an operating system d.none

ans.a compiler

48.A character variable can at a time store a.1 character

b.8 characters c.254 characters

(8)

d.none

ans.1 character

49.if a is an integer then a=5/2 will return value a.2.5

b.3 c.2 d.0 ans.2

50.expression a=7/22*(3.14+2)*3/5 evaluates to a.8.28

b.6.28 c.3.14 d.0 ans.0

51.The members declared under ____ visibility label are hidden from external use. (i) public

(ii) private (iii) both (i) & (ii) (iv) none of these ans. (ii) private

52.Which is a wrong notation in C (v) printf

(vi) Printf (vii) scanf (viii) int a; ans. (ii) Printf

53.When we use functions strlen(), strrev() we must include (ix) #include<string.h>

(x) #include<iostream.h> (xi) #include<fstream.h> (xii) #include<iostring.h> Ans. (i) #include<string.h> 54.Which datatype can store largest value

(xiii) int (xiv) float

(9)

(xv) double (xvi) none of these ans. (iii) double

55.Object is a variable whose datatype is (xvii) integer

(xviii) class (xix) structure (xx) float ans. (ii) class

56.FORTRAN is………….language. a)low level b)high level c)mid level d)machine level ans.(b)

57)An integer constant must have a)At least one decimal point b)A commas along with digit c)At least one digit

d)Digits separeted by commas ans.(c)

58)…….reads full line of input into a string until a new line or EOF is encountered a)puts

b)gets c)printf d)scanf ans.(b)

59)Floats occupy……….bytes in memory a)3 b)2 c)4 d)5 ans.(c) 60)&& is……….. a)Arithmatic operator b)Relational operator c)Logical operator d)Assignment operator ans.(c)

61)A character variable can at a time store………character. a)1 b)8 c)254 d)2 ans.(a) 62.Float*ptr :

(10)

In the above declaration data type of ptr is______ and data type of variable pointed by ptr is______.

(i) Float, float (ii) Float,int (iii) Int, float (iv) Pointer, float Ans :- (iv);pointer,float

63.Last character of a string

is-(i) 0

(ii) \0 (iii) \n (iv) End

Ans :- (ii); \0

64.When we use string functions such as strlen(), strrev() etc. Then must include file –

(i) #include<string.h> (ii) #include<iostream.h> (iii) #include<fstream.h> (iv) #include<iostring.h> Ans :- (i); #include<string.h>

65.If all visibilitiy lebels are missing, then by default members of class are –

(i) Public (ii) Protected (iii) Private (iv) Any of these

Ans :- (iii),private

66.When a member function is defined inside the class, then it is treated as a ____

(11)

(ii) Outline (iii) External (iv) Virtual Ans:- (i), inline

67.C++ was develoved by Bjarne stroustrup at – (i) Xerox corporation

(ii) AT and T Bell laboratories

(iii) Polo Alu Research Centre (PARC) (iv) None of these

Ans:- (ii); AT and T Bell laboratories

68._____ is not a derived data type in C++

-(i) Class

(ii) Array (iii) Function (iv) Pointer Ans:- (i); Class

69.A derived class with several base classes is_______ inheritance-(i) Single

(ii) Multiple (iii) Multilevel (iv) Hierarchical Ans:- (ii); Multiple

70.______ is not the feature of OOPs.

(i) Polymorphism

(ii) Inheritance (iii) Data Abstraction (iv) Top-Down Approach Ans:- (iv); Top- Down Approach

(12)

(i) Procedure Oriented (ii) Event Driven

(iii) Object Oriented (iv) Database

Ans:- (iii); Object oriented 72.The program execution starts from (a) the function which is first defined (b) main()function

(c) the function which is last defined (d) the function other than main() ANS = b

73.How many main() functions can be defined in a C program (a) 1

(b) 2 (c) 3

(d) any number of times ANS = a

74.A character vriable can at a time store (a) 1 character

(b) 8 chatacters (c) 254 characters (d) None of the above ANS=b

75.Which of the following statement is false

(a) Each new C instruction has to be written on a separate line (b) Usually all C statements are entered in small case letters (c) Blank spaces may be inserted between two words in a C

statemernt.

(d) Blank spaces cannot be inserted within a integer variables. ANS=a

(13)

76. Identify the correct statement

(a) a function can be defined more than once in a program (b) function definition cannot appear in any order

(c) functions cannot be distributed in many files

(d) one function cannot be defined within another function definition ANS = d

77.what would be the output of the following program? Main( ) { Char str1[]=”hello”; Char str2[]=”hello”; If (strl=str2) Printf(“\nequal”); Else Printf(“\nunequal”); } a. equal b. unequal c. error d. none of these ANS= a

78.if the file to be included does not exist the pre processor flashes an error message? 1. true

2. false

3.none of these ANS=1

79.would it result into an error if a header file is included twice?

1 yes 2 no

3 none of these ANS=1

(14)

80.usually recursion works slower than loops

1 true 2 false

3 none of these ANS=a

81.In the following code in which order the function would be called? 1 .F1, f2, f3

2 .F3, f2, f1

3 .The order may vary from compiler to compiler 4 .None of these

ANS=b 82.Float*ptr :

In the above declaration data type of ptr is______ and data type of variable pointed by ptr is______.

(v) Float, float (vi) Float,int (vii) Int, float (viii) Pointer, float Ans :- (iv);pointer,float

83.Last character of a string

is-(v) 0

(vi) \0 (vii) \n (viii) End

Ans :- (ii); \0

84.When we use string functions such as strlen(), strrev() etc. Then must include file –

(v) #include<string.h> (vi) #include<iostream.h> (vii) #include<fstream.h> (viii) #include<iostring.h>

(15)

Ans :- (i); #include<string.h>

85.If all visibilitiy lebels are missing, then by default members of class are –

(v) Public (vi) Protected (vii) Private (viii) Any of these

Ans :- (iii),private

86.When a member function is defined inside the class, then it is treated as a ____

function-(v) Inline (vi) Outline (vii) External (viii) Virtual Ans:- (i), inline 87.C was develope by A) wright brother B) charles babbage C) dennis ritchis D) graham bell Ans-C 88.Meaning of opperater “<<” A) shift right B) shift left

C) more greater than D) more less than Ans-B

89. is shape represent by

(16)

B) Computation C) Subroutine D) Connector

Ans-B

90.Algorithem is

A) finite sequence of instruction B) use for calculation

C) processing data D) All of this

91.”ftell”

A) some important libray take B) take intput from use

C) Use to tell current position of pointer in the file D) Use to pass imformation to the program Ans-C

92.C languages are converted to machine languages by 1) an editor

2)a compiler

3)an operating system 4)none

Ans:a compiler

93)which of the following is character constant 1)thank you

2)enter values of p,n,r 3)23.56e-03

4)none

94)the real constant inc can be expressed in which of the following forms 1)fractional only

2)exponential only 3)ASCII value form only 4)both 1,2

Ans:exponential only

95)which of the following statement is wrong 1)mes=123

2)con=154 3)this=111

(17)

4)3+a=d Ans:3+a=d

96)C language has been developed by 1)ken Thomson

2)dennis Ritchie 3)peter norton 4)martin Richards Ans:Dennis Ritchie

97)by default any real number is treated as A)a float

B)a double C)a long double

D)depends upon the memory model that you are using Ans-a double

98.Any ‘C’ program must contain a fuction named main( ), which actually act as an ……of program to be executed.

a)Entry point, b)Executed point , c)End point , d)Building block function Ans d)Bulding block function

99. The concept of giving only one task to a function is known as…… a)Library function, b)User defined function, c) chesion, d)Task Ans c)cohesion

100. How many data type in ‘C’ program?

a)Float b) Double c)Int, Float, d)Char, Int, Float,Double Ansd)Char, Int, Float, Double

101. Sntax of int, pointer to int &pointer to pointer int… a)int i,*j, **k; b)j*int**k; c)int i**j*k; d)int i**j,**k; Ans a)int i ,*j ,**k;

102. B language in the process of developing the language we now know as… a) B language, b) Java language, c)Java & C language , d) C language Ans d) C language

103.What would be the output of the following program? Main( ) { Printf (“\n%x”,-1>>4); } 1. ffff 2. 0fff 3. 0000 4. fff0 ANS: 1

104. The maximum combined length of the command like arguments including the space between adjacent argument is

1.128 character 2.256 character 3. 67 character

4. it may vary from operating system to another ANS: 4

105.Every computer understand only one language without using translation program, called as:

(18)

a. Assembly language b. Machine language c. High level language d. None of these Ans : ( b )

106.As assembly language program converted into machine language with the help of: e. Linker

f. Compiler g. Assembler h. Interpreter Ans:( c )

107Any instructions which are translated to machine language instructions , is called: a. Macro instruction

b. Micro instructions c. Both a & b d. None of these Ans:( a )

108. High level language converted to machine language with the help of: a. Assembler

b. Compiler c. Linker d. Interpreter Ans:( b )

109 Compiler cannot detect: a. syntax error b. logic error c. both a & b d. none of these Ans:( b)

110.The machine language of computer written as:

i. English language

j. 0s and 1s language

k. High level language

l. None of these

Ans : ( b )

111.An original assembly language program is called as:

m. Source programe

n. Object program

o. both

p. none of these

Ans:( a )

112.additional instructions in assembly language are called as: e. True instructions

f. Pseudo insructions g. both

h. none of these Ans:( a )

113.assembly language introduced in: a. 1920

(19)

c. 1947 d. 1952 Ans:( d )

114. machine language program are called as: a. source programe

b. object programe c. both a & b d. none of these Ans:( b)

115.The variables arge and argv are always local to main A .true

B .false C .none ANS:a

116. what will be the following program output? Main ( int argc,char*argv[],char*env[]) {

Int I ;

For (i=1;i<argc;i++) Printf(“%s”,env[i]); }

A .list of all environment variables B .list of all commands line arguments C .error

D .null ANS:b

117 Detect the error in following program for addition #include <stdio.h> #include <conio.h> Void main() { int p=200,q=100; printf(“value=%d\n”,p+q); getch( );

A)syntax error B)logic error C)no error D) both A&B Ans= A

118 Bugs means

A)logic error B)syntax error C)Both A & B D) testing of error Ans= C

119.Debugging is the process of

A)validating the correctness of the program B)eliminating error in the program

C)testing of data

D)identifying logic & syntax error Ans= B

(20)

#include<stdio.h> int num; void main() { int j; j=num++; printf(“the value of j=%d\n”,j); } A) 2 B) 1 C) 0 D) unpredictable Ans= D 121. ASCII value of \0 is A) 1 B)48 C)0 D)100 Ans= C

122.Which of following is true about argv ? A .it is an array of character pointers

B it is a pointer to an array of character pointers C. none

D .it is an array of strings ANS: a

123.Does there exits anyway to make the command line argument available to others function without passing them as arguments to the function ?

A .yes B .no C .none ANS: a

124 .What would be the output of the following program ? Main ( )

{

Unsigned char i=0*80; Printf(“\n%d”,i<<1); } A .0 B .256 C .100 D .none ANS: B

125. What would be the output of the following program ? Main ( ) { Int i=32,j=0*20,k,l,m; K=i/j; L=i&j; M=k^l; Printf(“%d%d%d%d%d”,i,j,k,l,m); } A .32 32 32 32 0 B . 0 0 0 0 0 C . 0 32 32 32 32 D . 32 32 32 32 32

(21)

ANS: a

126.Are the property of i,j and x,y in the following program same ? Typedef unsigned long int uli ;

Uli , i , j;

unsigned long int x, y ; A. yes

B. no C. none

127.by default any real number is treated as A)a floate

B)a double C)a long double

D)depends upon the memory model that you are using Ans –B

128.what would the output of the following program? Main( )

{

Char ch=a;

Printf(“%d%d”,size of (ch),size of (a)); } A)1 1 B)1 2 C)2 2 D)2 1 Ans-B

129.what would be the output of following program? Main( ) { Printf(“%c”,”abcdefgh”[4]; } A)error B)e C)d

D)none of the above Ans-c

130.the binary equivalent of 7.375 is A)101.101110111

B)101.011 C)101011 D)none of above Ans-B

131.what would be the output of following program? Main( )

{

Float a=0.7 If(a<0.7) Printf(“c++”);

(22)

Else Printf(“c++”); } A)c B)c++ C)error D)none of above Ans-B

132.To concatenate second statement on to the end of first statement we use A)strcpy(st1,st2) B)strcat(st1,st2) C)strchr(st1,ch) D)strstr(st1,st2)

Ans= B

133.in following program main()

{

Message();

Printf(“\n cry,and you stop the monotony”); }

Message() {

Printf(“\n smile, & the world smiles with you…”); }

The calling function is

A)main() B) message() C) no calling function D) void Ans= A

134.when we use puts function the curser goes on A) next line B)next word C)first line D) none of these Ans= A

135.the logic error in program

A)gives right result B)doesn’t give result C) shows error D) gives wrong result Ans = D

136.the different methods for locating and correcting logic errors

A)by using debugger B)using memory dump C)putting print statement in the program code D)all of these

Ans=D

137.Logic errors contains a) incorrect word sequence

b) error in planning of the program’s logic c) undefined terms

d) incorrect punctuation.

Ans: c) Errors in planning of the program’s logic. 138.Arrays are passed as arguments to a function by a) value

b) reference c) both a & b d) none of the above

(23)

Ans: c) both a & b

139.Consider the following statements int a=2, b=3, c=4

a=(b++)+c; b=a+(++c); the values of a,b,c

a) 8,12,5 b) 8,13,5 c) 7,12,5 d) 7,11,5 Ans: c) 7,12,5.

140.Detect the error in the given program for the simple interest #include<stdio.h> Void main() { float prin,noy,roi,intrst; printf(“enter principle\n”); scanf(“%f”, &prin);

printf(“enter number of years\n”); scanf(“%f”, &noy);

printf(“enter the rate of intrst\n”); scanf(“%f”, &roi);

intrst=(prin+noy+roi)/100; printf(“\n intrst%7.2*f”, intrst);

a) logic b) syntax c) both d) no error Ans: a) logic (logic is (prin*noy*roi)/100 141.Write the output of the following

n =7;

printf(“%d%d%d”, n++, n, n--); a) 787 b) 667 c) 778 d) 887 Ans; d) 887

142. “C” was developed by at bell laboratories in 1972 by a)John orthor

b)Dennis Ritche c)Michael Johnson d)None of these Ans-(b)

143.which is primary datatype a)arrays

b)structures c)long d)float Ans-(d)

144)which is not a part of a for loop a)initialization

b)condition c)testing d)counter Ans-(c)

(24)

145)which is a data that can hold several values all of one type a)pointer b)arrays c)nested d)string Ans-(b)

146)which is derived datatype ,which is collection of dismillar basic datatype a)union

b)nested c)pointers d)array Ans-(a)

147)which data function is used to identify a function a)return function

b)parameter list c)body of function d)name of function Ans-(d)

148)which variable is called automatic or auto variables a)register variables

b)local variables c)static variables d)external variables Ans-(b)

149)which of the following is primary datatype? a)float

b)arrays c)structures d)unsigned Ans-(a)

150)integer datadtype has which of the following range of value? a)-128to127 b)-32768 to +32767 c)3.4e-38 to 3.4e+38 d)1.7e-308 to 1.7e +308 Ans-(b) 151)”^” operator means a)shift right b)bitwise OR c)bitwise AND d)bitwise exclusive Ans-(d)

152)If ‘a’ is an integer variable, a=5/2 will return value”_

(25)

b)3 c)2 d)0 Ans.: c)

153. Which of following statement is false_

a)Each new C instruction has to be written on a separate line.

b)Usually all C statement is entered in small case letters.

c)Blank spaces may be inserted between two words in a C statement.

d)Blank spaces can’t be inserted within integer variable.

Ans.:a)

154)C language has been developed at_

a)Microsoft b)AT&T Labs c)Borland d)IBM Ans.:b)

155) ‘Break’ statement is used to exit from_

a)if statement b)for loop c)program d)main function Ans.:a)

156)The expression x=4+2%-8 evaluates to_

a)-6 b)6 c)4 d)None of these Ans.:c) 157 what would be

output of the following program?

Main() { Int a[5]={2,3}; Printf(“in%d%d%d”,a[2],a[3],a[4]; } a.garbage value b.2 3 3 c. 3 2 2 d. 000

(26)

ans d. 158.Is it true that too many recursive calls may result into stack overflow?

a.yes b.no c.none

ans yes

159.the maximum combined length of the command line arguments including the spaces between adjacent arguments is

a. 128 characters b. 256 characters c. 67 characters

d. It may vary from one operating system to another. Ans 256 characters

160.which of the following is true about argv a.it is an array of character pointers.

b.it is a pointer to an array of character pointer. c. it is an array of strings.

d. none of the above. Ans a

161.by default any real number is treated as e. a float

f. a double g. a long double

h. depends upon the memory model that you are using. Ans b.

162.C language has been developed by a. ken Thomson

b. dennis Ritchie c. peter Norton d. martin Richards ans; dennis Ritchie

163.C language are covered to machine language withn the help of a. an editor

b. a compiler

c.an operating sustem d.none

ans

;a compiler

164.which of the following is not character constant a. thank you

b.enter values of p,n,r. c.23.56e-03

d.none ans ;none

165the real constants in ccan be expressed in which of the following forms a.fraction only

(27)

b.exponential only ASCII value from only d.botha,b

ans exponential only

166. which of the following statement is wrong a.mes=123

b.con=154 c.=111 d.3+a=d ans 3+a=d.

167)C language has been developed by A) Ken Thomson

B) Dennis Ritchie C) Peter Norton D) Martin Richard Ans-Dennis Ritchie

168) expression a=7/22*(3.14+2)3/5 evaluates to A) 8.28

B) 6.28 C) 3.14 D) 0 ANS-0

169) A character variable can at a time score A) 1 character

B) 8 character C) 254 character D)none

ANS-1 character

170)If a is an integer then a=5/2 will return value A) 2.5

B) 3 C) 2 D) 0 ANS-2

171)C language converted to machine language with the help of A) An editor

B) A compiler

C) an operating system D) none

ANS a compiler

172.The members declared under visibility hidden from external use A.Public

B.Private C.both

(28)

D.None And=B

173.Which is wrong notation in A.printf

B.scanf C.int F D.Printf Ans=D

174.Which of the following is true about argv? A.It is nay array of character pointers.

B.It is a pointer to array of character pointers. C.It is an array of strings.

D.None of these. Answer=A

175.By default, any real number is treated as A.Float

B.double C.Long double

D.Depends upon memory model. Ans=B

176.object is a variable whose data type is A.integer B.class C.structure D.float answer=B 177. C language is A. middle level language B. high level language C. low level language D.none

Ans=A

178.c program are converted in to machine language with the help of A.An interpreter

B.a compiler

C. An operating system D. none of these Ans=B

179.A C variable can not starts with A. an alphabet

(29)

B. A number

C. A special symbol D. both B&C Ans=D

180.the break statement is used to exist for A.an if statement

B.for loop C. a program

D.the main()function Ans=A

181.C language was developed

by-a)Bell b)Dennis Ritchie c)Ken d)Rashie Answer-b)Dennis Ritchie

182.What is the range of datatype ‘char’?

a)-127to128 b)-128to128 c)-128to127 d)-127to127 Answer-c)-128to127

183.Float occupies how many bytes? a)1 b)2 c)0 d)4

Answer-d)4

(*)Variable value address i 4 1000 J 1000 1002

184.From above find the value of *&i ? a)4 b)1000 c)1002 d)0

Answer-a)4

185.from the above table what is the value of &j ? a)4 b)1000 c)1002 d)0

Answer-c)1002 186.String is a set

of-a)ascii values b)float values c)characters d)integers Answer-c)characters

187.If the datatype of a function is void, then the function , a) returns a value,

b) does not return a value, c) may or may not return a value, d) none of these.

Answer- b

(30)

a) void, int, char, double. b)main, char, int, double. c) void, int, char, float.

d) void, signed int, char, double. Answer- c

189. The output of following program is-#include<stdio.h> #include<conio.h> void main() { char c[2]=”A”; printf(“\n %c”, c); getch(); } a) \0, b) A

c) Any garbage value, d) AB.

Answer- b

190.Float*ptr :

In the above declaration data type of ptr is______ and data type of variable pointed by ptr is______.

(ix) Float, float (x) Float,int (xi) Int, float (xii) Pointer, float Ans :- (iv);pointer,float

191.Last character of a string is-(ix) 0

(x) \0

(xi) \n (xii) End

Ans :- (ii); \0

192.When we use string functions such as strlen(), strrev() etc. Then must include file –

(31)

(x) #include<iostream.h> (xi) #include<fstream.h> (xii) #include<iostring.h> Ans :- (i); #include<string.h>

193. If all visibilitiy

lebels are missing, then by default members of class are – (ix) Public

(x) Protected (xi) Private (xii) Any of these

Ans :- (iii),private

194.When a member function is defined inside the class, then it is treated as a ____

function-(ix) Inline (x) Outline (xi) External (xii) Virtual Ans:- (i), inline

195. A string

is-a) One dimensional array of characters terminated by \0, b) 2 dimensional array of characters,

c) A pointer,

d) a one dimensional array of characters terminated by 0. Answer-a

196. the output of following program if i is stored at the memory location, 1000 is #include<stdio.h.> #include<conio.h> void main() { int i=3,*j,**k; j=&i; k=&j; printf(“%d”,**k); getch(); }

(32)

a)1000, b)1002, c)3, d)1003. Answer- c

197)acharacter variablr can at a time store a)1characrer

b)8character c)254character d)none

a)1characrer

198)ifa is aninterger variable a=5/2 will return a valu a)2.5

b)3 c)2 d)0 b)2

199)the expression x=7/22*(3.14+2)*3/5 evaluaates to a)8.28

b)6.28 c)3.14 d)0 d)0

200)the expression x=4+2/-8 evaluaates to a)-6

b)6 c)4 d)none c)6

201)the expression x=30*1000+2768 evaluaates to a)32768

b)-32768 c)113040 d)0 a)-32768

202.)the statement char ch=’Z’ would store in ch a)the char z

b)ASCII value of Z

c)Z along with the single inverted commas d) both a&b

203)A C can not start with a) an alphabate

b) a number

c)a special symbol other than underscores d)both b& c

204) HIEARCHY decides which operator a)is most important

(33)

b)is used first c)is fastest

d)operators on larges numbers 205)which of the statement is false

a) key words can be used as veriable names b)veriable can cotain a digit

c)veriable names do not contain a blank space d)capital letters can be used in veriable names 206)the expression a=40*1000+3756 evaluates to a)403756

b)-403756 c)113040 d)0

207 C was developed by denis @ a Microsoft lab

b AT&T BELL lab c infosys lab d dr reddy lab ans B

208.What is a difference between a declaration and a definition of a variable? • Both can occur multiple times, but a declaration must occur first. • There is no difference between them.

• A definition occurs once, but a declaration may occur many times. • A declaration occurs once, but a definition may occur many times.[Ans] • Both can occur multiple times, but a definition must occur first.

209.int a=10,b; b=a++ + ++a;

printf("%d,%d,%d,%d",b,a++,a,++a);

what will be the output when following code is executed?

• 22,10,11,13

• 22,11,11,11

• 12,11,11,11

• 22,13,13,13[Ans]

210.C is which kind of language? • Machine

• Procedural[Ans] • Assembly • Object-oriented • Strictly-typed

(34)

211.In a C expression, how is a logical AND represented? • @@ • || • .AND. • && [Ans] • .AND

212.According to the Standard C specification, what are the respective minimum sizes (in bytes) of the following three data types: short; int; and long?

• 1, 2, 2 • 1, 2, 4 • 1, 2, 8 • 2, 2, 4[Ans] • 2, 4, 8

213.which of the following is not a header file used in C prog a <stdio.h>

b <conio.h> c <math.h> d <pco.h> ans D

214 full form of BASIC is

a Begginer’s all purpose symbolic instruction code b begginer’s all purpose systematic instruction code c begginer’s all purpose symbolic international code d begginer’s all purpose systematic international code ans A

215.c language has been developed at a)Microsoft corp,USA

B)at&t Bell laba,USA C)Borland international,USA d)IBM,USA

ans:b 216.C IS A

a)middle laevel language b)high level language c)low level language d)none of these

ans:d

217.c language came into existence in the year a)1971

(35)

c)1972 d)1983 ans:c

218.what is the difference between following declarations? Extern int fun();

Int fun();

a.one gives full information about the other function.

b.no difference except for the fact that first one gives a hint that the function fun() is probably in another source file.

c.no difference except for the fact that second one gives hint for the first function. d.none of these

Ans:no difference except for the fact that first one gives a hint that the function fun() is probably in another source file.

219.what is the output of the following program? Main() { Int a[s]={2,3}; Printf(“/n%d%d%d”a[2],a[3],a[4]); } a)1 1 1 b)0 0 0 c)a b c d)3 3 3 ans:b 220. The operation of “/n” is a. new line b. horizontal line c. backspace d. None of these ans.a

221. The equality operator is a. &&

b. = c. ! d. = = ans.d

222. The symbol for decision box is a. c.

b. d. none of these

ans.c

223. The header file required by the standard input/output library function is _________

(36)

b.stdio.h c.conio.h d. none of these ans b

224.The operation of “\b” stands for a. New line b. Horizontal line c. Previous line d. Backspace ans d.

225 Every C prog is ter minated by a getch()

b void main () c stdio.h d conio.h ans A

226 --- is used to translate HLL prog to M/c language prog a Linker

b Compiler c Interpreter d Translater ans B

227.The maximum length of a C variable name can be of a. 6 characters

b. 8 characters c. 10 characters

d. depends on compiler Ans: depends on compiler

228.A character variable can at a time store a. 1 character

b. 8 characters c. 254 characters d. depends on compiler Ans: 1 character

229. A do..while loop is useful when we want the statements within the loop to be executed a. at least once

b. once only c. more than once d. none

Ans: at least once

230.The ‘break’ statement is used to exit from a. an ‘if’ statement

b. a ‘for’ loop c. a program

(37)

Ans: an ‘if’ statement

231. The max no. of bytes that a ‘float’ data type can occupy is/are a. 1

b. 4 c. 8 d. 2 Ans: 4

232.which of the following statement is FALSE

1. each new C instruction has to be writtion on a separate line 2. Usually all C statements are entered in small case letters. 3. Blank spaces are entered in small case letters.

4. Blank spaces can not be inserted in a variable name Ans:3

233.The expression X= 4 + 2 % - 8 evaluates to 1. -6

2. 6 3. 4

4. none of these Ans: 1

234. An integer constant in C must have 1. at least one digit

2. at least one decimal point 3. a comma along with digit 4. digit separated by commas Ans: 4

235. A C a variable cannot contain 1. blank spaces

2. Hyphen 3. decimal point 4. all of the above Ans: 4

236.Which of the following is odd one out 1. +

2. – 3. / 4. ** Ans: 4

237.By default any prime number is treated as? a A float

b A double

c A long double

d Depending upon the memory model that you are using Answer- b A double

238.what would be the output of the following program? Main( )

(38)

{

Extern int fun(float);

Int a; A= fun(3.14); Printf(“%d”,a); } Int fun(aa) Float aa; {

Return( (int) aa) } a. 3 b. 3.14 c. 0 d. Error Answer d.error 239.can we use a switch statement to switch on strings?

Answer. No

240.what would be the output of the following program? Main( ) { Int i=3; I=i++ Printf(“%d”,i) } Answer. 4

241what would be the output of the following program? Main( )

{

Int i=2;

Printf(“\n%d%d”,++I,++i); }

Answer. Output may vary from compiler to compiler

242. C program can be converted to machine language by a.Interpreter

b.Compiler

c.Operating systems d.None of above Ans:(b)

(39)

243.C variable cannot start with a.Alphabet b.Number c.Special symbols d.both b&c Ans:(d)

244.Which of following is allowed in arithmatic instruction a.[ ] b.{ } c.( ) d.None of above Ans:(c) 245.C can be used on

a]only MS-DOS operating system b]only Linux operating system c]only Windows operating system d]All of the above

Ans:(d)

246. If 'a' is an integer variable,then a=5/2 will return a]2.5 b]3 c]2 d]None of above Ans:(c)

247.C language has been developed at 1.microsoft corp USA

2.AT & t Bell labs,USA 3.borland international,USA 4.JBM,USA

ans.2 248.’C’ is a

1.middle level language 2.high level language 3.low level language 4.none of these ans.3

249.C program converted into machine language with help of 1.A interpreter

2.A compiler

3.An operating system 4.none of these ans.2

250.which of following are ternary operater 1.?,:

2.! 3.&&,”

(40)

4.none of these ans.1

251.pick the odd one out 1.a=a+1

2.a+=1 3.a++ 4.a=+1 ans.4

252.Which of the following is not the language? a) C b) c++ c) COBOL d) Compiler

ans.: d) Compiler

253.Which of the below established a standard definition of ‘C’ in 1983? a) ANSI b) BCPL c) CPL d) NONE

ans.: a)ANSI

254.Which of the below is not used in drawing the flowchart? a) Ellipse b) rectangle c) Triangle d) Parallelogram ans.: c) Triangle

255.After which of the below the semicolon (:) is given a) if b) printf ( ) c) while d)for

ans.: b) printf( )

256.Using array which of the following is used a) Name b) dimension c) size d) all the above ans.: d) all the above

257.Detect the error in following program for addition #include <stdio.h> #include <conio.h> Void main() { int p=200,q=100; printf(“value=%d\n”,p+q); getch( );

A)syntax error B)logic error C)no error D) both A&B Ans= A

258.Bugs means

A)logic error B)syntax error C)Both A & B D) testing of error Ans= C

259.Debugging is the process of

A)validating the correctness of the program B)eliminating error in the program

C)testing of data

D)identifying logic & syntax error Ans= B

(41)

260.consider the given program given below #include<stdio.h> int num; void main() { int j; j=num++; printf(“the value of j=%d\n”,j); } A) 2 B) 1 C) 0 D) unpredictable Ans= D 261.ASCII value of \0 is A) 1 B)48 C)0 D)100 Ans= C

262. C program can be converted to machine language by a.Interpreter

b.Compiler

c.Operating systems d.None of above Ans:(b)

263.the operation "\b" stands for a.new line

b.Number c.back space d.both b&c Ans:c

264.Which of following is allowed in arithmatic instruction a.[ ] b.{ } c.( ) d.None of above Ans:(c) 265.C can be used on

a]only MS-DOS operating system b]only Linux operating system c]only Windows operating system d]All of the above

Ans:(d)

266.function used to find squareroot is a]sqst() b]getch() c]clrscr() d]None of above Ans:a

(42)

267.To concatenate second statement on to the end of first statement we use A)strcpy(st1,st2) B)strcat(st1,st2) C)strchr(st1,ch) D)strstr(st1,st2)

Ans= B

268.In following program main()

{

Message();

Printf(“\n cry,and you stop the monotony”); }

Message() {

Printf(“\n smile, & the world smiles with you…”); }

The calling function is

A)main() B) message() C) no calling function D) void Ans= A

269.when we use puts function the curser goes on B) next line B)next word C)first line D) none of these Ans= A

270.the logic error in program

A)gives right result B)doesn’t give result C) shows error D) gives wrong result Ans = D

271.the different methods for locating and correcting logic errors

A)by using debugger B)using memory dump C)putting print statement in the program code D)all of these

Ans=D

272. c language came into existence in the year (1)1972

(2)1920 (3)1982 (4)1979 Ans.1

273.The ---- function reads data from keyboard. (1)read

(2)printf (3)scanf (4)write Ans.3

274.which of the fallowingis the character of programing language. (1)simplicity

(2)efficiency (3)both 1&2 (4)non of these Ans. 3

(43)

275.c is a ---level language. (1)middle (2)high level (3)low level (4) non of these Ans. 2

276.which of the following is not data type. (1)char

(2) float (3)int (4)logical Ans.4

277.C language has been developed by A) Ken Thomson

B) Dennis Ritchie C) Peter Norton D) Martin Richards Ans:B

278.C language has been developed at E) Microsoft corporation,USA F) AT & T Bell labs,USA G) Borland International,USA H) IBM,USA

Ans:B

279.C language came into existence in the year A)1971 B)1957 C)1972 D)1983 Ans:C 280.C is a

E) Middle level language F) High level language G) Low level language H) None of the above Ans:D

281.A DO WHILE LOOP IS USEFUL WHEN WE WANT THAT THE STATEMENTS WITHIN THE LOOP MUST BE EXECUTED

E) Only once F) At least once G) More than once H) None of the above Ans:B

(44)

282.Which of the following is a librarian?

a) float b) if else c) while d)#include<stdio.h> ans: d

283.which of the following is format rectifier? a)for loop b){} c)while d)int

ans:d

284.The function used to take input from keyboard is called a)printf b)scanf c)for d)getch

ans-b 285.int is denoted by A)%c b)%d c)% d)%f Ans—c 286.float is denoted by a)%c b)%d c)%a d)%f ans-d

287.WHAT IS THE RANGE OF CHARACTER DATA TYPE ? a.-128 to 127

b.0 to 255

c.-32768 to 32768

d.0 to 65535 (ans.a)

288.HOW MUCH MEMORY USED FOR FLOAT DATA TYPE IN BYTES ?

a.2 b.4 c.8

d.16 (ans.b) 289.WHAT IS THE SYMBOL OF ‘LOGICAL NOT’ ? a.&&

b.!! c.||

d.! (ans.d) 290.IF a IS AN INT VARIABLE a=5/2 WILL RETURN a.2.5

b.3 c.2

d.0 (ans: c ) 291.HIERARCHY DECIDES WHICH OPERATOR

a.is not important b.is used first c.is fastest

(45)

d.operates on large numbers (ans.b) 292.C is a --- level language 1.machine level 2.high level 3.low level 4.simple level Ans.2

293.The ‘break’ statement is used to exit from 1.an if statement

2.a for loop 3.a program

4.the main( ) function Ans.1

294.A ‘do while’ statement is useful when we want the statement within for loopmust be executed

1.at least once 2.Only once 3.More than once 4.None of above Ans.1

295.What is difference between 5’s in this expression? Int[5]

Num[5]

1.first is particular element&second isarray size 2.first isarray size &second is particular element 3.both specify arrays & their sizes

4.both specify int type elements Ans.2

296.An array is collection of –

1.different datatypes scattered throughout the memory 2.same datatypes placed next to each memory

3.the same datatypes scattered throuout the memory 4.different datatypes placed next to each memeory Ans.2

297.which of the following is allowed in C arithmatic instruction a.[ ]

b.{ } c.( ) d.none ANS--b

(46)

298.A character variable can at atime store ----character a.1 b.8 c.6 d.7 ANS--b 299.C is a---level language a.middle b.no language c.high d.low ANS--c

300.C programs are converted into machine level by----a.an interpreter

b.a compiler

c.an operating system d.none

ANS--a compiler

301.The expression n=4+2%-8 evaluates to ---a.-6 b.6 c.4 d.none ANS--d 302 --- is conditional statement. 1.if else 2.for loop 3.do while 4.none Ans=1.

303.float data type can occupy maximum ----no. of bytes. 1.4

2.8 3.6 4.10 Ans=1

304)range of signal integer type lies between 1.-32765 to +32765

2.0 to 6535 3.-128 to 127

4.1.7e308 to +1.7e308 Ans=1

(47)

1.%c 2.%d 3.%f 4.%u Ans=3

306)what will be the value of d if d is a float after the operation d=2/7.0 1.0

2.0.2857

3.cannot be determined 4.none

Ans=2

307.The 3 methods by way of which we can repeat a program 1.for st.

2.while st. 3.do while st. 4.all of these Ans.4

308.--- is a compound assignment operator 1.+=

2.-=< 3.++/ 4.<= Ans 1

309.operation between a real and real always yields 1.int

2.real 3.real and int 4.none Ans 2

310.which operator cannot be applied on float 1.+

3./ 4.% Ans 4

311.part appearing before e is called 1.exponent

2.real 3.modulus 4.mantissa Ans 4

(48)

a)Arrays b)Float c)Pointer d)None Ans- b 313.Binary equivalent of 5.375 is ? a)101.10111011 b)101.011 c)10101 d)1110000111 Ans-b

314.What is correct order of operator in C ? a) + - * /

b) () * / + -c) - / * + d) / () * - + Ans-b

315.To print out a&b given below,which printf() statement would you use ? Float a=3.14; Double b=3.14; a)printf(“%f%f”,a,b); b) printf(“%Lf%f”,a,b); c) printf(“%Lf%Lf”,a,b); d) printf(“%f%Lf”,a,b); Ans-a

316.Which of the is correct function in c a)clrscr(0)

b)main() c)getch 0 d)none Ans-b)

317.Which is the maximum value stored in unsigned integer ? a)32767

b)0 c)65000 d)-32768

(49)

Ans-c

318.What is output of following program ? Main() { Printf(“%f”,sqrt(36.0)); } a)6.0 b)6 c)6.000000 d)none Ans-d)

319.Which of the following is a not library ? a) <math.h >

b) if else c) <conio.h> d)<stdio.h> ans: b

320.Which is the second datatype in C ? a)integer

b)character c)pointer d)float Ans-c

312.which of the following is format rectifier? a)for loop

b){} c)while d)int ans:d

313. WHAT WOULD BR THE OUTPUT OF THE FOLLOWING PROGRAM ? main( )

{ int a;

printf(“\n%d”,a); }

int a=20;

A. 20 B. 0 C. Garbage value D. error CORRECT ANSWER: A=20

(50)

main( ) { int i=1; while ( ) { printf(“%d”,i++); if (i>10) break; }}

A.the condition in the while loop is a must. B.There should be at last a semicolon in while( ) C.The while loop should be replaced by a for loop. D.No error.

CORRECT ANSWER A

315.IN THE FOLLOWING CODE IN WHICH ORDER FUNCTIONS WOULD BE CALLED? a=(f1 (23,14)*f2(12/4))+f3( );

A. f1 ,f2 ,f3 B. f3 ,f2 ,f1

C. the oordermay vary from compiler to compiler. D.none of the above.

CORRECT ANSWER- C

316. BY DEFAULT ANY REAL NUMBER IS TREATED AS A. a float

B. a double C. a long double

D. depends upon the memory model that you are using CORRECT ANSWER- B

317. THE BINARY EQUIVALENT OF 5.375 IS – A.101.10111O111

B.101.011 C.101011

D.none of the above. CORRECT ANSWER- B

318. What would be the output of the following program? main( )

{ char far*s1, s2;

printf(“%d%d”,size of (s1),size of(s2)); }

A. 4 2 B. 2 4 C. 1 2 D. 2 1 Correct ans. A

319. In the following program where variable a getting declared? main( ) { extern int a; printf(“%d”,a); } int a=20; A. 10 B.20 C. 30 D. 40 Correct ans. B 320. C can be used on A.MS-DOS B.UNIX

(51)

C.XENIX D.ALL ABOVE Correct ans.D.

321.C programs are converted into machine language with the help of A. interpreter B. compiler C. operating system D. none

Correct ans. B

322. A character variable can at a timestore __ characters? A. 1 B. 8 C. 254 D. none

Correct ans.- A

323.The maximum value that an integer constant can have-A. –32767 B. 32767 C. 1.243545 D.-1.3462

Correct ans. A

324. The maximun width of a C variable name can be__ characters A. 6 B. 8 C. 10 D. 20

Correct ans.- B

325.A “C” variable can’t start with

A. an alphabet B. a number C. a special symbol D. both B & C Correct ans.- D

326.Which of the following is allowed in a C Arithmatic instruction A. [ ] B. { } C. ( ) D. NONE

Correct ans.- C

327.If a is an integer variable, a=5/2; will return a value A. 2.5 B. 3 C. 2 D. 0

Correct ans. B

328.C LANGUAGE HAS BEEN DEVELOPED BY A) KEN THOMPSON

B) DENNIS RITCHE C) PETER NORTON D) MARTIN RICHARDS ANS) DENNIS RITCHE

329.C LANGUAGE HAS BEEN DEVELOPED AT A) MICROSOFT CORP,USA

B) AT & T BELL LABS , USA

C) BORLAND INTERNATIONAL , USA D) IBM , USA

ANS) AT & T BELL LABS , USA

330.C LANGUAGE CAME INTO EXISTENCE IN YEAR A) 1971

B) 1957 C) 1972 D) 1983 ANS) 1983

(52)

331.C IS A

A) MIDDLE LEVEL LANGUAGE B) HIGH LEVEL LANGUAGE C) LOW LEVEL LANGUAGE D) NONE OF THE ABOVE ANS) NONE OF ABOVE

332.A DO WHILE LOOP IS USEFUL WHEN WE WANT THATSTATEMENT WITHIN THE LOOP MUST BE EXECUTED.

A) ONLY ONCE B) MORE THAN ONE C) AT LEAST ONCE D) NONE OF ABOVE ANS)AT LEAST ONCE

333. c language has been developed by a. ken Khomson

b. Dennis Ritchie c. Peter Norton d.Martin Richards ans. Dennis Ritchie

334. c language are converted to machine language with the help of a. an editor

b.a compiler

c. an oprating system d.none

ans a compiler

335. a character variable can at a time store a.1character

b.8character c.254 characters d. none

ans 1 characters

336. the maximum eange that an integer constant can have is a.-32767

b.32787 c. 1.7014e+38 d.none

ans. 32767

337. a C variable cannot start with a. an alphabet

b. a number

c.a special symbol other than underscopre d. both b&c above

(53)

338. The members declared under ____ visibility label are hidden from external use i] public

ii] private iii] both i and ii iv] none of these0 ANS- ii

339. Which is a wrong notation in C i] printf

ii] Printf iii] scanf iv] int a ans- ii

340. When we use functions strlen(), strrev(), we must include i] # include<string.h>

ii] # include <iostream.h> iii] #include <fstream.h> iv] # include <iostring.h> ANS- iv

341. Which datatype can store largest value i] int

ii] float iii] double iv] all are same ANS- iii

342. Object is variable, whose datatype is i] integer

ii] class iii] structure iv] float ANS- ii

343..Maximum number of bytes that a long double data type can occupy is a.4

b.2 c.8 d.10

344.A character variable can at a time store a. 1 char

b. 2 char c.3 char d. 4 char ANS: 1 char

345.Maximum number of files that can be occupied by float that ‘float’ data type can be occupied in memory is

(54)

a.1 b.2 c.3 d.4 ANS: 4

346.Which is odd one out a.+

b.-c./ d.** ANS: **

347.Break statement is used to exit from a.if statement

b.for loop c.program d.none of these ANS: if statement

348. C programs are converted into machine langauge with the help of a.) An Editor

b.) A compiler

c.) An operating system d.) None of these ans--b.) A compiler

349. The real constant in C can be expressed in which of the following forms a.) Fractional form only

b.) Exponential form only c.) ASCII for only d.) Both a.) and b.) ans--d.) Both a.) and b.)

350. C language has been developed at a.)Microsoft Corp.,USA

b.)AT&T Bell Labs,USA c.)Borland International,USA d.)IBM,USA

ans--b.)AT&T Bell Labs,USA

351)C language came into existence in the year a.)1971

b.)1957 c.)1972 d.)1982 ans--c.)1972

(55)

352.)Which of the following is allowed in a C Arthmetic instruction a.) [ ]

b.) { } c.) ( )

d.) None of the above ans--c.) ( )

353.) Hierarchy decides which operator a.) is most important

b.) is used first c.) is faster

d.) operates on largest numbers ans--b.) is used first

354.)Which of the following statement is wrong a.)mes =1213.56;

b.)con='T'*'A' c.)this = 'T'*20 d.)3+a=b ans--d.)3+a=b

355)The ________ Function is used to display the output on the screen.

a.)scanf b.)printf c.)int

d.)float ans----b.)printf

356.)A header file is :

a.) A file that contains standard library function. b.)A file that contains defination and marcos c.)A file that contains user-defined function

d.)A file that is present in current working directory. ans--b.)A file that contains defination and marcos

357.) which of the following is not a preprocessor directory a.) #if

b.) #else if c.) #undef d.) #pragma ans--b.) #else if

(56)

358.)If character strings is to be recieved through the keyboard,which function would work faster?

a.) scanf() b.) gets() c.) printf()

d.) None of the above ans--a.) scanf()

359.) In a program the statement

#include"filename" is replaced by the contents of the "filename"

a.) Before compilation b.) After compilation c.) During execution d.) None of the above ans--c.) During execution

360.) C language has been developed by a.) Ken Thompson

b.) Dennis Ritchie c.) Peter Norton d.) Martin Richards ans--b.) Dennis Ritchie

361.)If an interger is to be entered through the keyboard,which function would you use? a.) scanf() b.) getche() c.) gets() d.)getchar() ans--a.) scanf() 362.Float*ptr :

In the above declaration data type of ptr is______ and data type of variable pointed by ptr is______.

(xiii) Float, float (xiv) Float,int (xv) Int, float (xvi) Pointer, float

(57)

Ans :- (iv);pointer,float

363.Last character of a string is-(xiii) 0

(xiv) \0 (xv) \n (xvi) End

Ans :- (ii); \0

364.When we use string functions such as strlen(), strrev() etc. Then must include file –

(xiii) #include<string.h> (xiv) #include<iostream.h> (xv) #include<fstream.h> (xvi) #include<iostring.h> Ans :- (i); #include<string.h>

365.If all visibilitiy lebels are missing, then by default members of class are –

(xiii) Public (xiv) Protected (xv) Private (xvi) Any of these

Ans :- (iii),private

366When a member function is defined inside the class, then it is treated as a ____

function-(xiii) Inline (xiv) Outline (xv) External (xvi) Virtual Ans:- (i), inline

367.ALGORITHAM STARTS WITH 1.STOP

(58)

2.END 3.START 4.BEGIN ANS 3

368.GCD MEANS

1.GREATER COMMON DIVISER 2.GREATER COMMON FACTOR 3.BOTH A B

4.NONE OF THESE ANS 1

369. WHILE LOOP USED FOR

1.EXECUTE LOOPS FOR FIXED NO. OF TIME 2.NOT FOR FIXED NO. OF TIME

3.BOTH 4.NONE ANS 2 370.I/O FUNCTION IS A. PRINTF B.SCANF C.BOTH D.NONE ANS C 371.CLRSCR IS USED FOR 1. CLEAR SCREEN 2. TO EXIT 3. TO MINIMISE 4.NONE ANS 1 372..--- is conditional statement. 1.if else 2.for loop 3.do while 4.none Ans= 1).if else.

373.float data type can occupy maximum ----no. of bytes. 1.4

(59)

3.6 4.10 Ans=1).4

374.part appearing before e is called 1.exponent

2.real 3.modulus 4.mantissa Ans=4). mantissa

375. which of the following is not data type. 1.char

2. float 3.int 4.logical Ans.=4).logical.

376. The ‘break’ statement is used to exit from 1. an ‘if’ statement

2. a ‘for’ loop 3. a program

4. the main( ) function Ans:=1). an ‘if’ statement

377) The macro file is defined in which of the following files 1. stdlib.h

2. stdio.c 3. io.h 4. stdio.h Ans: stdio.h

378) An array is collection of:

1. Different data types scattered throughout memory 2. The same data type scattered throughout memory 3. The same data type placed next to each other in memory 4. Different data types placed next to each other in memory Ans: The same data type placed next to each other in memory

379) Do-while loop is useful when we want that statement within loop must be executed: 1. Only once

2. At least once 3. More than once 4. None of these Ans: Only once

380) Hierarchy decides which operator is 1. Most important

2. Used first 3. Fastest

(60)

4. Operates on largest no. Ans: Used first

381) Which of following statement is used to take control to beginning of loop? 1. Exit 2. Break 3. Continue 4. N.O.T Ans: Continue

382.Which of the following is not computer language-Binary .

High level Machine level Natural Ans:d)

383.A do-while loop is useful when we want that the statement within the loop must be

executed-a) Only once b) At least once c) More than once d) None

Ans:b)

384.Which of the following is the program design tool that is a visual presentation of the logic in

function-a) Flow-chart b)Structure chart c)Water fall model d)None

Ans:a)

385.The expression a=30*1000+2768 evaluates to-a)0

b)113040 c)34465 d)None Ans:d)

386. The break statement is used to exit a) An 'if' loop

b) A 'for' loop c) A program

d) The main( ) function Ans- a)

(61)

387.C language is – a) high level language b) low level language c) middle level language d) none of these

Ans=c

388.C program can be converted into machine language with the help of an interpreter

a compiler

an operating system none

Ans=b

389.C language has been developed at a) Microsoft corp. USA

b) AT & Tbell lab USA c) Borland international USA Ans= b

390.the expression a=30*1000+2768 evaluates to a) 32768

b)-32768 c)113040 d)0 Ans=a

391.the computer language that most closely resembles with the machine language is a)assembly

b) cobol c) fortran

d) high level languge Ans= a

392.header file is:

a)a file that contains standard library functions. b)a file that contains definition and macros c)a file that contains user defined functions

d)a file that is present in current working directory. ans

393.Real constant in c can be expressed in which of the following forms: a)fractional form only

b)exponential form only, c)ascii form only

d)both a and b ans.

394.A character variable can never store more than: a)32 char

(62)

c)8 char d)1 char ans.

395. break statement is used to exit from : a)if statement

b)program c)for loop

d)main ( ) function ans.

396.an integer variable a=5/2 will return value: a)2.5

b)2 c)3 d)0 ans.

396 A function is identified by an open parenthesis following (a) a keyword

(b) an identifier other than keywords (c) an identifier including keywords (d) an operator

ANS = b

398.Parameters are used

(a) to return values from the called function (b) to send values from the called function (c) options a and b

(d) to specify the data type of the return value ANS = c

399. Find out the output void main() { int a="%d"; printf("%d",a); } a . %d b . 25637 c . 37 d . % ANS=a

(63)

400.Which of the following statement is false

1. Each new C instruction has to be written on a separate line 2. Usually all C statements are entered in small case letters

3. Blank spaces may be inserted between two words in a C statemernt. 4. Blank spaces cannot be inserted within a integer variables.

ANS=a

401. Identify the correct statement

(a) a function can be defined more than once in a program (b) function definition cannot appear in any order

(c) functions cannot be distributed in many files

(d) one function cannot be defined within another function definition ANS = d

402. C variable cannot start with 1.An alphapet

2.A number 3.A special symbol 4.Both 2 & 3 above ans-4

403The break statement is used to exit form 1.an if statement

2.a for loop 3.a programme 4.The main ( )function ans-2

404.An array is a collection of

1.Different data types scattered throughout memory. 2.The same data scattered throughout memory.

3.The same data type placed next to each within memory. 4.Different data types placed next to each other to memory. ans-3

405.The macro FILE is defined in which of the following files 1.stdlib.h

2.stdio.c 3.io.h 4.stdio.h ans-2

406.Programs stored in which of the following memories cannot be erased 1.RAM

(64)

3.Cache memory 4.Virtual memory ans-1

407.C program are converted into machine language with help of (1) an editor

(2) A compiler

(3) An operating system (4) None of the above Ans : (2)

408. A character variable can at a time store (1) 1 character

(2) 8 character (3) 254 character (4) None of the above Ans : (1)

409.,in what sequence the initialization , testing and executionof body is donein a do while loop (1) initialization , execution of body, testing

(2) Execution of body ,initialization ,testing (3) Initialization, testing, execution of body (4) None of the above

Ans: (3)

410. Which of the following statement is used to take control to the beginning of the loop (1) Exit

(2) Break (3) Continue

(4) None of the above Ans : (3)

411. When you pass an array as an argument to a function what actually gets passed ? (1) Address of the array

(2) Values of the element (3) Address of the first element (4) Number of the element in array Ans : (1)

412. A character variable at a time store a) 1 character

b) 8 character c) 254 character d) None of these Ans.) A

413 The break statement is used to exit from a) An if statement

b) A loop statement c) A program

(65)

d) The main ( ) function Ans.) B

414 In C, Arithmetic instructions cannot contain a) Variables

b) Constants

c) Variable names on right side of = d) Constant on left side of =

Ans.) B

415. A header file is

a) A file that contains standard library functions b) A file contains definations and macros c) A file that contains user defined functions d) A file that is present in current working directing Ans.) A

416 Which of these are reasons for using pointers a) To manipulate parts of an array

b) To refer to key words such as for or it

c) To return more than one value from the function d) To refer to particular programs more conveniently Ans,) C

417.The program execution starts from (a) the function which is first defined (b) main()function

(c) the function which is last defined (d) the function other than main() ANS = b

418.How many main() functions can be defined in a C program (a) 1

(b) 2 (c) 3

(d) any number of times ANS = a

419.A character vriable can at a time store (e) 1 character

(f) 8 chatacters (g) 254 characters (h) None of the above

(66)

ANS=b

420.The maximum value that an

integer constants can have is (a) -32767

(b) 32767 (c) 1.7014e+38 (d) -1.7014e+38 ANS=b

421 A function is identified by an open parenthesis following (a) a keyword

(b) an identifier other than keywords (c) an identifier including keywords (d) an operator

ANS = b

422 . A function is identified by an open parenthesis following (a) a keyword

(b) an identifier other than keywords (c) an identifier including keywords (d) an operator

ANS = b

423.Parameters are used

(a) to return values from the called function (b) to send values from the called function (c) options a and b

(d) to specify the data type of the return value ANS = c

424. Find out the output void main() { int a="%d"; printf("%d",a); } a . %d b . 25637

(67)

c . 37 d . % ANS=a

425.Which of the following statement is false

(e) Each new C instruction has to be written on a separate line (f) Usually all C statements are entered in small case letters (g) Blank spaces may be inserted between two words in a C

statemernt.

(h) Blank spaces cannot be inserted within a integer variables. ANS=a

426.Identify the correct statement

(a) a function can be defined more than once in a program (b) function definition cannot appear in any order

(c) functions cannot be distributed in many files

(d) one function cannot be defined within another function definition ANS = d

427.Which of the following is allowed in a C arithmetic instruction-A.[ ] B. { } C.( ) NONE.

ans c

428.The expression ,a=30* 1000+2768; evaluates to A. 32768 B. –32768 C. 113040 D. 0

ans.c

429 Hierarchy decides which operator A. is most important B. is used first

C.is fastest D. operates on largest numbers Correct ans. B

430 If u don’t initialize a static array, what will be the elements set to? A. 0 B. an undetermined value

B. a floating pt. no. D. character constant ‘\0’ Correct ans. A

431. The macro FILE is defined in which of the following files? A. stdlib.h B. stdio.c C. io.h D. stdio.h

(68)

Correct ans. D

432.C programs are converted into machine language with the help of B. interpreter B. compiler C. operating system D. none

Correct ans. B

433. THE BINARY EQUIVALENT OF 5.375 IS – A.101.10111O111

B.101.011 C.101011

D.none of the above. CORRECT ANSWER- B

434. C LANGUAGE HAS BEEN DEVELOPED BY A) KEN THOMPSON

B) DENNIS RITCHE C) PETER NORTON D) MARTIN RICHARDS ANS) DENNIS RITCHE

435. C LANGUAGE HAS BEEN DEVELOPED AT A) MICROSOFT CORP,USA

B) AT & T BELL LABS , USA

C) BORLAND INTERNATIONAL , USA D) IBM , USA

ANS) AT & T BELL LABS , USA

436.C LANGUAGE CAME INTO EXISTENCE IN YEAR A) 1971 B) 1957 C) 1972 D) 1983 ANS) 1983 437.C was developed by a. Wright Brothers b. Charles Babbage c. Albert Einstein d. Dennis Ritchie ans.d 438.Algorithm is

e. used for calculation

f. finite sequence of instructions g. processing data

h. none of these ans.f

439.sqrt function is included in which library i. <stdio.h>

j. <conio.h> k. <math.h>

References

Related documents

To trim down the list of files to show just one type (if you’re looking for a GIF file, for example): Click the Files of Type selection box and choose that type from the many file

(total number of display data file and event data file) Manual saving: Data files in internal memory can be

Although the flash memory on OmniSwitch 6600 Family switches can contain many file types (e.g., log and snapshot files), there are four specific file types that provide key switch

On the File menu select Get External Data File Get External Data and click Import Import.. Select Text Files in the Files of type Text Files Files of type drop down and navigate

Typically used to store programs and very large data files.. Uses

Thus, the client should use IT solutions to secure these files (see File Types section). In the following, three potential strategies for securing the local NucleoView™ data files

The type property for objects of these classes default to defined iTool data types shown in the following table.... iTool Data Type Contents IDLVECTOR A vector of any IDL

While working with MS-DOS which command is used to copy all files with extension .txt into one file named all.txt.. While working with MS-DOS, which command is used to more file