Date post: | 26-Nov-2014 |
Category: |
Documents |
Upload: | kaushal-shah |
View: | 1,009 times |
Download: | 0 times |
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=c3.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 byA) Ken Thomson B) Dennis RitchieC) Peter NortonD) Martin RichardsAns:B
7C language has been developed atA) Microsoft corporation,USA B) AT & T Bell labs,USAC) Borland International,USAD) IBM,USAAns:B
8.C language came into existence in the yearA)1971B)1957C)1972D)1983Ans:C
9.C is aA) Middle level languageB) High level languageC) Low level languageD) None of the aboveAns:D
10.A DO WHILE LOOP IS USEFUL WHEN WE WANT THAT THE STATEMENTS WITHIN THE LOOP MUST BE EXECUTEDA) Only onceB) At least onceC) More than onceD) None of the aboveAns:B
11. A character variable can store at a timeA) 1 character
B) 8 characterC) 254 charactersD) None of the aboveAns=B
12. The break statement is used to exit fromA) if statementB) for loopC) a programmeD) the main functionAns=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 timesANS=1 15.A character variable can at a time store(a) 1 character(b) 8 character(c) 254 character(d) None of the aboveANS=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 folla. a keywordb. an identifier other than keywords.c. An identifier including keywords.d. An operatorAns= b
18.C language has been developed by1. ken Thompson.2. Dennis Ritchie.3. Peter Norton.
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 outptVoid main(){ int a=”%d”Printf(“%d”);} 1.%d2. 256373.374. %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. 12. 83. 2544. none of the above. Ans=2
23.C language has been developed by
a] Ken Thomsponb] Dennis Ritchec] Martin Richardd] Nats Thomson
Ans-b
24.C can be used ona] Ms-Dos OSb] Linux OSc] Windowsd] All Of Above
Ans-d
25.A character variable can at a time store a] 1b] 8c] 256d] 1024Ans-a
26.C programs converted into machine language with the help ofa] editorb] compilerc] operating systemd] none of above
Ans-b
27.In C a variable cannot containa] blank spacesb] hypenc] decimal pointd] all of above
Ans-d
28. C programme are converted into machine level language with the help ofA) an interpreterB) a compiler C) an operating systemD) none of the aboveAns=B
29.A header file is a fileA) that contains standard library functionsB) that contains definations and macrosC) that contains user definer functionsD) that is present in current working dictionaryAns=C
30. what will be the output of programme?main();{int i; for(i=1;i<=5;printf(“\n%d”,i));i++;
}
A) 51234B) 12345C) 35241D) 54321Ans=B
31.WHICH ERROR IS DISPLAYED IF ‘;’IS MISSING?a)Declaration errorb)Statement missingc)None of thesed)No error
Ans-b
32.Sqrt funcyion is included in which library?a)stdio.hb)conio.hc)math.hd)none of these
Ans-c
33.C language came into existence ina)1972b)1865c)1975d)1986
Ans-a
34.Which is the format specifier for integera)%sb)%d c)%fd)%c
Ans-b
35.A integer at 1 time can store?a)2 bytesb)4 bytesc)8 bytesd)32 bytes
Ans-a
36) which of the following is librarian ?A)printf]b)scanf
c)#include<stdio.h>d)whileans- c
37)the function used to take input from keyboard is a)scanfb)printfc)if elsed)getchans-a
38)float is denoted by a)%db)%fc)%dd)%aans-b
39)which of the following is format specifiera)if elseb)whilec)intd)scanfans-c
40)the function used to print the message or value contenta)printfb)scanfc)whiled)forans-a
41.C language has been developed by
a.Ken Thomsonb.Dennis Ritchiec.Peter Nortond.Martin Richards
ans.Dennis Ritchie
42.C languages are converted to machine language with the help of
a.an editorb.a compilerc.an operating system
d.none
ans.a compiler
43. A character variable can at a time store
a.1 characterb.8 charactersc.254 charactersd.none
ans.1 character
44.The maximum eange that an integer constant can have is a.-32767b.32767c.1.7014e+38d.none
ans.32767
45.a C variable cannot start with a.an alphabetb.a numberc.a special symbol other than underscored.both b and c above
ans, d. both b and c above.46.C language has been developed by
a.Ken Thomsonb.Dennis Ritchiec.Peter Nortond.Martin Richards
ans.Dennis Ritchie
47.C languages are converted to machine language with the help of
a.an editorb.a compilerc.an operating systemd.none
ans.a compiler
48.A character variable can at a time store
a.1 characterb.8 charactersc.254 characters
d.none
ans.1 character
49.if a is an integer then a=5/2 will return valuea.2.5b.3c.2d.0
ans.2
50.expression a=7/22*(3.14+2)*3/5 evaluates toa.8.28b.6.28c.3.14d.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
(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 :
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,float63.Last character of a string is-
(i) 0(ii) \0(iii) \n(iv) End
Ans :- (ii); \064.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),private66.When a member function is defined inside the class, then it is treated as a ____ function-
(i) Inline(ii) Outline(iii) External(iv) Virtual
Ans:- (i), inline67.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 laboratories68._____ 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); Multiple70.______ is not the feature of OOPs.
(i) Polymorphism(ii) Inheritance(iii) Data Abstraction(iv) Top-Down Approach
Ans:- (iv); Top- Down Approach71.Programming in C++ using classes is called_______ programming –
(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 timesANS = 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=b75.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 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. equalb. unequalc. errord. none of theseANS= 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 theseANS=1
79.would it result into an error if a header file is included twice?
1 yes 2 no 3 none of theseANS=1
80.usually recursion works slower than loops
1 true 2 false3 none of these
ANS=a
81.In the following code in which order the function would be called?1 .F1, f2, f32 .F3, f2, f13 .The order may vary from compiler to compiler 4 .None of these
ANS=b82.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,float83.Last character of a string is-
(v) 0(vi) \0(vii) \n(viii) End
Ans :- (ii); \084.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>
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),private86.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), inline87.C was develope by
A) wright brotherB) charles babbageC) dennis ritchisD) graham bell
Ans-C
88.Meaning of opperater “<<”
A) shift rightB) shift leftC) more greater thanD) more less than
Ans-B
89. is shape represent by
A) Input/ outputB) ComputationC) SubroutineD) 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 takeB) 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 4)3+a=d Ans:3+a=d
96)C language has been developed by 1)ken Thomson 2)dennis Ritchie
3)peter norton4)martin RichardsAns:Dennis Ritchie
97)by default any real number is treated asA)a floatB)a doubleC)a long doubleD)depends upon the memory model that you are usingAns-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 function99. 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)cohesion100. How many data type in ‘C’ program? a)Float b) Double c)Int, Float, d)Char, Int, Float,Double Ansd)Char, Int, Float, Double101. 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 language103.What would be the output of the following program? Main( )
{ Printf (“\n%x”,-1>>4); }
1. ffff2. 0fff3. 00004. 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:
a. Assembly languageb. Machine languagec. High level languaged. None of these
Ans : ( b )106.As assembly language program converted into machine language with the help of:
e. Linkerf. Compilerg. Assembler
h. Interpreter Ans:( c )
107Any instructions which are translated to machine language instructions , is called:a. Macro instructionb. Micro instructionsc. 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 languagej. 0s and 1s languagek.High level languagel. None of these
Ans : ( b )111.An original assembly language program is called as:
m. Source programen.Object programo.bothp.none of these
Ans:( a )112.additional instructions in assembly language are called as:
e. True instructionsf. Pseudo insructionsg. both h. none of these
Ans:( a ) 113.assembly language introduced in: a. 1920 b. 1857 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:b117 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&BAns= A
118 Bugs meansA)logic error B)syntax error C)Both A & B D) testing of errorAns= C
119.Debugging is the process of A)validating the correctness of the programB)eliminating error in the programC)testing of dataD)identifying logic & syntax errorAns= B
120.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
121. ASCII value of \0 isA) 1 B)48 C)0 D)100Ans= 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 .0B .256C .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 0B . 0 0 0 0 0C . 0 32 32 32 32 D . 32 32 32 32 32 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. noC. none
127.by default any real number is treated as A)a floate B)a doubleC)a long doubleD)depends upon the memory model that you are usingAns –B128.what would the output of the following program? Main( ) { Char ch=a; Printf(“%d%d”,size of (ch),size of (a)); } A)1 1B)1 2 C)2 2D)2 1Ans-B
129.what would be the output of following program? Main( ) { Printf(“%c”,”abcdefgh”[4];}A)errorB)eC)dD)none of the aboveAns-c130.the binary equivalent of 7.375 isA)101.101110111B)101.011C)101011D)none of aboveAns-B
131.what would be the output of following program? Main( ) { Float a=0.7 If(a<0.7) Printf(“c++”); 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) voidAns= A
134.when we use puts function the curser goes on A) next line B)next word C)first line D) none of theseAns= A
135.the logic error in program A)gives right result B)doesn’t give result C) shows error D) gives wrong resultAns = 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 theseAns=D
137.Logic errors contains a) incorrect word sequence
b) error in planning of the program’s logicc) undefined termsd) incorrect punctuation. Ans: c) Errors in planning of the program’s logic.138.Arrays are passed as arguments to a function bya) valueb) referencec) both a & bd) none of the above
Ans: c) both a & b139.Consider the following statements
int a=2, b=3, c=4a=(b++)+c;b=a+(++c);the values of a,b,ca) 8,12,5 b) 8,13,5 c) 7,12,5 d) 7,11,5Ans: 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 followingn =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 bya)John orthorb)Dennis Ritchec)Michael Johnsond)None of theseAns-(b)
143.which is primary datatype a)arraysb)structuresc)longd)floatAns-(d)
144)which is not a part of a for loopa)initializationb)conditionc)testingd)counterAns-(c)
145)which is a data that can hold several values all of one typea)pointerb)arraysc)nestedd)stringAns-(b)
146)which is derived datatype ,which is collection of dismillar basic datatype
a)unionb)nestedc)pointersd)arrayAns-(a)
147)which data function is used to identify a functiona)return functionb)parameter listc)body of functiond)name of functionAns-(d)
148)which variable is called automatic or auto variablesa)register variablesb)local variablesc)static variablesd)external variablesAns-(b)
149)which of the following is primary datatype?a)floatb)arraysc)structuresd)unsignedAns-(a)
150)integer datadtype has which of the following range of value?a)-128to127b)-32768 to +32767c)3.4e-38 to 3.4e+38d)1.7e-308 to 1.7e +308Ans-(b)
151)”^” operator meansa)shift rightb)bitwise ORc)bitwise ANDd)bitwise exclusiveAns-(d)
152)If ‘a’ is an integer variable, a=5/2 will return value”_a)2.5b)3c)2d)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)Microsoftb)AT&T Labsc)Borland d)IBM
Ans.:b)
155) ‘Break’ statement is used to exit from_a)if statementb)for loopc)programd)main function
Ans.:a)
156)The expression x=4+2%-8 evaluates to_a)-6b)6c)4d)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 valueb.2 3 3c. 3 2 2d. 000ans d.
158.Is it true that too many recursive calls may result into stack overflow?a.yesb.noc.noneans yes
159.the maximum combined length of the command line arguments including the spaces between adjacent arguments is
a. 128 charactersb. 256 charactersc. 67 charactersd. 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 floatf. a doubleg. a long double h. depends upon the memory model that you are using.Ans b.
162.C language has been developed by a. ken Thomsonb. dennis Ritchiec. peter Nortond. martin Richards
ans; dennis Ritchie
163.C language are covered to machine language withn the help ofa. an editorb. a compilerc.an operating sustemd.noneans ;a compiler
164.which of the following is not character constanta. thank youb.enter values of p,n,r.c.23.56e-03d.noneans ;none
165the real constants in ccan be expressed in which of the following formsa.fraction onlyb.exponential onlyASCII value from onlyd.botha,bans exponential only
166. which of the following statement is wronga.mes=123
b.con=154c.=111d.3+a=dans 3+a=d.
167)C language has been developed byA) Ken ThomsonB) Dennis RitchieC) Peter NortonD) Martin RichardAns-Dennis Ritchie
168) expression a=7/22*(3.14+2)3/5 evaluates toA) 8.28B) 6.28C) 3.14D) 0ANS-0
169) A character variable can at a time scoreA) 1 characterB) 8 characterC) 254 characterD)noneANS-1 character
170)If a is an integer then a=5/2 will return valueA) 2.5B) 3C) 2D) 0ANS-2
171)C language converted to machine language with the help ofA) An editorB) A compilerC) an operating systemD) noneANS a compiler
172.The members declared under visibility hidden from external useA.PublicB.PrivateC.bothD.NoneAnd=B
173.Which is wrong notation inA.printfB.scanfC.int F
D.PrintfAns=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.FloatB.doubleC.Long doubleD.Depends upon memory model.
Ans=B
176.object is a variable whose data type isA.integerB.classC.structureD.float
answer=B 177. C language is A. middle level languageB. high level languageC. low level languageD.noneAns=A
178.c program are converted in to machine language with the help of A.An interpreter B.a compiler C. An operating systemD. none of these Ans=B
179.A C variable can not starts with A. an alphabetB. A numberC. A special symbolD. both B&CAns=D
180.the break statement is used to exist forA.an if statement
B.for loopC. a programD.the main()functionAns=A
181.C language was developed by-a)Bell b)Dennis Ritchie c)Ken d)RashieAnswer-b)Dennis Ritchie
182.What is the range of datatype ‘char’?a)-127to128 b)-128to128 c)-128to127 d)-127to127Answer-c)-128to127
183.Float occupies how many bytes?a)1 b)2 c)0 d)4Answer-d)4
(*)Variable value address i 4 1000 J 1000 1002184.From above find the value of *&i ?a)4 b)1000 c)1002 d)0Answer-a)4
185.from the above table what is the value of &j ?a)4 b)1000 c)1002 d)0Answer-c)1002
186.String is a set of-a)ascii values b)float values c)characters d)integersAnswer-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
188. The 4 basic datatypes are,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) Ac) Any garbage value,d) AB.
Answer- b190.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,float191.Last character of a string is-
(ix) 0(x) \0(xi) \n(xii) End
Ans :- (ii); \0192.When we use string functions such as strlen(), strrev() etc. Then must include file –
(ix) #include<string.h>(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();
}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)nonea)1characrer198)ifa is aninterger variable a=5/2 will return a valu a)2.5 b)3 c)2 d)0b)2199)the expression x=7/22*(3.14+2)*3/5 evaluaates to a)8.28 b)6.28 c)3.14
d)0d)0200)the expression x=4+2/-8 evaluaates to a)-6 b)6 c)4 d)nonec)6201)the expression x=30*1000+2768 evaluaates to a)32768 b)-32768 c)113040 d)0a)-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 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)403756b)-403756c)113040d)0
207 C was developed by denis @a Microsoft lab b AT&T BELL labc 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
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 codeans A
215.c language has been developed ata)Microsoft corp,USAB)at&t Bell laba,USAC)Borland international,USAd)IBM,USA
ans:b
216.C IS A a)middle laevel languageb)high level languagec)low level languaged)none of these
ans:d
217.c language came into existence in the yeara)1971b)1957c)1972d)1983ans: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 1b)0 0 0
c)a b cd)3 3 3ans:b
220. The operation of “/n” is a. new line b. horizontal line c. backspace d. None of theseans.a221. The equality operator is a. && b. = c. ! d. = = ans.d222. 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 _________ a.iostream.h b.stdio.h c.conio.h d. none of theseans 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.hd conio.hans A226 ----------- is used to translate HLL prog to M/c language prog a Linkerb Compilerc Interpreterd Translaterans B
227.The maximum length of a C variable name can be ofa. 6 charactersb. 8 charactersc. 10 charactersd. depends on compilerAns: depends on compiler
228.A character variable can at a time store a. 1 character b. 8 characters c. 254 charactersd. depends on compilerAns: 1 character
229. A do..while loop is useful when we want the statements within the loop to be executed a. at least onceb. once onlyc. more than onced. noneAns: at least once
230.The ‘break’ statement is used to exit from a. an ‘if’ statement b. a ‘for’ loopc. a programd. the main( ) functionAns: an ‘if’ statement
231. The max no. of bytes that a ‘float’ data type can occupy is/area. 1b. 4c. 8d. 2Ans: 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. -62. 63. 44. 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. Hyphen3. decimal point4. all of the above
Ans: 4236.Which of the following is odd one out
1. +2. –3. /4. **
Ans: 4237.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( ) { Extern int fun(float);
Int a;A= fun(3.14);Printf(“%d”,a);
}Int fun(aa)
Float aa;{
Return( (int) aa)}
a. 3b. 3.14c. 0d. Error
Answer d.error239.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 aboveAns:(b)
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 USA2.AT & t Bell labs,USA3.borland international,USA4.JBM,USAans.2248.’C’ is a 1.middle level language2.high level language3.low level language 4.none of theseans.3249.C program converted into machine language with help of1.A interpreter2.A compiler3.An operating system4.none of these
ans.2250.which of following are ternary operater1.?,:2.!3.&&,”4.none of these
ans.1251.pick the odd one out 1.a=a+12.a+=13.a++4.a=+1ans.4252.Which of the following is not the language?a) C b) c++ c) COBOL d) Compilerans.: d) Compiler
253.Which of the below established a standard definition of ‘C’ in 1983?a) ANSI b) BCPL c) CPL d) NONEans.: a)ANSI
254.Which of the below is not used in drawing the flowchart?a) Ellipse b) rectangle c) Triangle d) Parallelogramans.: c) Triangle
255.After which of the below the semicolon (:) is givena) if b) printf ( ) c) while d)forans.: b) printf( )
256.Using array which of the following is useda) Name b) dimension c) size d) all the aboveans.: 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&BAns= A
258.Bugs meansA)logic error B)syntax error C)Both A & B D) testing of errorAns= C
259.Debugging is the process of A)validating the correctness of the programB)eliminating error in the programC)testing of dataD)identifying logic & syntax errorAns= B
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) unpredictableAns= D
261.ASCII value of \0 isA) 1 B)48 C)0 D)100Ans= C
262. C program can be converted to machine language by a.Interpreter b.Compiler c.Operating systems d.None of aboveAns:(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
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) voidAns= A
269.when we use puts function the curser goes on B) next line B)next word C)first line D) none of theseAns= A
270.the logic error in program A)gives right result B)doesn’t give result C) shows error D) gives wrong resultAns = 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 theseAns=D
272. c language came into existence in the year(1)1972(2)1920(3)1982(4)1979Ans.1
273.The ---- function reads data from keyboard.(1)read(2)printf(3)scanf(4)writeAns.3 274.which of the fallowingis the character of programing language.(1)simplicity(2)efficiency(3)both 1&2(4)non of theseAns. 3
275.c is a ---level language.(1)middle (2)high level(3)low level(4) non of theseAns. 2
276.which of the following is not data type.(1)char(2) float(3)int(4)logicalAns.4
277.C language has been developed byA) Ken Thomson B) Dennis RitchieC) Peter NortonD) Martin RichardsAns:B
278.C language has been developed atE) Microsoft corporation,USA F) AT & T Bell labs,USAG) Borland International,USA
H) IBM,USAAns:B
279.C language came into existence in the yearA)1971B)1957C)1972D)1983Ans:C
280.C is aE) Middle level languageF) High level languageG) Low level languageH) None of the aboveAns:D
281.A DO WHILE LOOP IS USEFUL WHEN WE WANT THAT THE STATEMENTS WITHIN THE LOOP MUST BE EXECUTEDE) Only onceF) At least onceG) More than onceH) None of the aboveAns:B
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)intans:d
284.The function used to take input from keyboard is called a)printf b)scanf c)for d)getchans-b
285.int is denoted by A)%c b)%d c)% d)%fAns—c
286.float is denoted bya)%c b)%d c)%a d)%fans-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
d.operates on large numbers (ans.b)
292.C is a ----- level language1.machine level2.high level3.low level4.simple levelAns.2
293.The ‘break’ statement is used to exit from1.an if statement2.a for loop3.a program4.the main( ) functionAns.1
294.A ‘do while’ statement is useful when we want the statement within for loopmust be executed1.at least once2.Only once3.More than once
4.None of aboveAns.1
295.What is difference between 5’s in this expression?Int[5]Num[5]1.first is particular element&second isarray size2.first isarray size &second is particular element3.both specify arrays & their sizes4.both specify int type elementsAns.2
296.An array is collection of –1.different datatypes scattered throughout the memory2.same datatypes placed next to each memory3.the same datatypes scattered throuout the memory4.different datatypes placed next to each memeoryAns.2
297.which of the following is allowed in C arithmatic instructiona.[ ]b.{ }c.( )d.noneANS--b
298.A character variable can at atime store ----charactera.1b.8c.6d.7ANS--b
299.C is a--------level languagea.middleb.no languagec.highd.lowANS--c
300.C programs are converted into machine level by----a.an interpreterb.a compiler c.an operating systemd.noneANS--a compiler
301.The expression n=4+2%-8 evaluates to ------a.-6b.6c.4
d.none ANS--d
302 ----- is conditional statement.1.if else2.for loop3.do while4.none
Ans=1.
303.float data type can occupy maximum ----no. of bytes.1.42.83.64.10Ans=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
305)format specifer for a float data type is 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 theseAns.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.noneAns 2
310.which operator cannot be applied on float 1.+ 2.- 3./ 4.%Ans 4
311.part appearing before e is called 1.exponent 2.real 3.modulus 4.mantissaAns 4
312.Which is a primary datatype in C ?a)Arraysb)Floatc)Pointerd)None
Ans- b
313.Binary equivalent of 5.375 is ?a)101.10111011b)101.011c)10101d)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 ca)clrscr(0)b)main()c)getch 0d)none
Ans-b)
317.Which is the maximum value stored in unsigned integer ?a)32767b)0c)65000d)-32768
Ans-c
318.What is output of following program ?Main(){Printf(“%f”,sqrt(36.0));}a)6.0b)6c)6.000000d)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)integerb)characterc)pointerd)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. errorCORRECT ANSWER: A=20314. POINT OUT THE ERROR, IF ANY IN WHILE LOOP.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 A315.IN THE FOLLOWING CODE IN WHICH ORDER FUNCTIONS WOULD BE CALLED? a=(f1 (23,14)*f2(12/4))+f3( );A. f1 ,f2 ,f3B. f3 ,f2 ,f1C. the oordermay vary from compiler to compiler.D.none of the above.CORRECT ANSWER- C316. BY DEFAULT ANY REAL NUMBER IS TREATED AS
A. a floatB. a doubleC. a long doubleD. depends upon the memory model that you are using
CORRECT ANSWER- B
317. THE BINARY EQUIVALENT OF 5.375 IS –A.101.10111O111B.101.011C.101011D.none of the above.
CORRECT ANSWER- B318. 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 1Correct 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. 40Correct ans. B
320. C can be used onA.MS-DOS B.UNIXC.XENIXD.ALL ABOVECorrect ans.D.
321.C programs are converted into machine language with the help ofA. 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. noneCorrect ans.- A323.The maximum value that an integer constant can have-
A. –32767 B. 32767 C. 1.243545 D.-1.3462Correct ans. A
324. The maximun width of a C variable name can be__ charactersA. 6 B. 8 C. 10 D. 20Correct ans.- B
325.A “C” variable can’t start with A. an alphabet B. a number C. a special symbol D. both B & CCorrect ans.- D
326.Which of the following is allowed in a C Arithmatic instructionA. [ ] B. { } C. ( ) D. NONE
Correct ans.- C
327.If a is an integer variable, a=5/2; will return a valueA. 2.5 B. 3 C. 2 D. 0Correct ans. B328.C LANGUAGE HAS BEEN DEVELOPED BYA) KEN THOMPSON B) DENNIS RITCHEC) PETER NORTOND) MARTIN RICHARDSANS) DENNIS RITCHE
329.C LANGUAGE HAS BEEN DEVELOPED ATA) MICROSOFT CORP,USAB) AT & T BELL LABS , USAC) BORLAND INTERNATIONAL , USA D) IBM , USAANS) AT & T BELL LABS , USA
330.C LANGUAGE CAME INTO EXISTENCE IN YEARA) 1971B) 1957C) 1972D) 1983ANS) 1983
331.C IS A A) MIDDLE LEVEL LANGUAGE B) HIGH LEVEL LANGUAGEC) LOW LEVEL LANGUAGED) NONE OF THE ABOVEANS) 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 ONCED) NONE OF ABOVEANS)AT LEAST ONCE
333. c language has been developed by a. ken Khomsonb. Dennis Ritchie c. Peter Nortond.Martin Richards
ans. Dennis Ritchie
334. c language are converted to machine language with the help of a. an editor
b.a compilerc. an oprating systemd.noneans a compiler
335. a character variable can at a time store a.1characterb.8characterc.254 characters d. none ans 1 characters
336. the maximum eange that an integer constant can have is a.-32767b.32787c. 1.7014e+38d.noneans. 32767
337. a C variable cannot start with a. an alphabet b. a numberc.a special symbol other than underscopred. both b&c above ans d.both b&c above.
338. The members declared under ____ visibility label are hidden from external usei] publicii] privateiii] both i and iiiv] none of these0
ANS- ii
339. Which is a wrong notation in C i] printfii] Printfiii] scanfiv] int aans- ii
340. When we use functions strlen(), strrev(), we must includei] # include<string.h>ii] # include <iostream.h>iii] #include <fstream.h>iv] # include <iostring.h>ANS- iv
341. Which datatype can store largest valuei] intii] float
iii] doubleiv] all are sameANS- iii
342. Object is variable, whose datatype isi] integerii] classiii] structureiv] floatANS- ii
343..Maximum number of bytes that a long double data type can occupy is a.4b.2c.8d.10
344.A character variable can at a time store a. 1 charb. 2 charc.3 chard. 4 charANS: 1 char
345.Maximum number of files that can be occupied by float that ‘float’ data type can be occupied in memory isa.1b.2c.3d.4ANS: 4
346.Which is odd one outa.+b.-c./d.**ANS: **
347.Break statement is used to exit from a.if statementb.for loopc.programd.none of theseANS: if statement
348. C programs are converted into machine langauge with the help ofa.) An Editorb.) A compilerc.) An operating systemd.) None of these
ans--b.) A compiler
349. The real constant in C can be expressed in which of the following formsa.) Fractional form onlyb.) Exponential form onlyc.) ASCII for onlyd.) Both a.) and b.)
ans--d.) Both a.) and b.)
350. C language has been developed ata.)Microsoft Corp.,USAb.)AT&T Bell Labs,USAc.)Borland International,USAd.)IBM,USA
ans--b.)AT&T Bell Labs,USA
351)C language came into existence in the yeara.)1971b.)1957c.)1972d.)1982
ans--c.)1972
352.)Which of the following is allowed in a C Arthmetic instructiona.) [ ]b.) { }c.) ( )d.) None of the above
ans--c.) ( )
353.) Hierarchy decides which operatora.) is most importantb.) is used first c.) is faster d.) operates on largest numbers
ans--b.) is used first
354.)Which of the following statement is wronga.)mes =1213.56;b.)con='T'*'A'c.)this = 'T'*20d.)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 marcosc.)A file that contains user-defined functiond.)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 directorya.) #ifb.) #else ifc.) #undefd.) #pragma
ans--b.) #else if
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 compilationb.) After compilationc.) During executiond.) None of the above
ans--c.) During execution
360.) C language has been developed bya.) Ken Thompsonb.) Dennis Ritchiec.) Peter Nortond.) 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
Ans :- (iv);pointer,float363.Last character of a string is-
(xiii) 0(xiv) \0(xv) \n(xvi) End
Ans :- (ii); \0364.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),private366When 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 2.END 3.START4.BEGIN
ANS 3
368.GCD MEANS 1.GREATER COMMON DIVISER 2.GREATER COMMON FACTOR3.BOTH A B4.NONE OF THESE
ANS 1
369. WHILE LOOP USED FOR 1.EXECUTE LOOPS FOR FIXED NO. OF TIME2.NOT FOR FIXED NO. OF TIME3.BOTH4.NONE
ANS 2
370.I/O FUNCTION ISA. PRINTFB.SCANFC.BOTHD.NONE
ANS C
371.CLRSCR IS USED FOR 1. CLEAR SCREEN2. TO EXIT3. TO MINIMISE4.NONE
ANS 1
372..----- is conditional statement.1.if else2.for loop
3.do while4.none
Ans= 1).if else.
373.float data type can occupy maximum ----no. of bytes.1.42.83.64.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.hAns: 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 memoryAns: 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 theseAns: Only once
380) Hierarchy decides which operator is 1. Most important 2. Used first 3. Fastest 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.TAns: Continue
382.Which of the following is not computer language-Binary .High levelMachine levelNatural 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 oncec) More than onced) 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-chartb)Structure chart c)Water fall modeld)None Ans:a)
385.The expression a=30*1000+2768 evaluates to-a)0b)113040c)34465 d)None
Ans:d)
386. The break statement is used to exit from- a) An 'if' loop b) A 'for' loop c) A program d) The main( ) function Ans- a)
387.C language is –a) high level languageb) low level languagec) middle level languaged) none of theseAns=c
388.C program can be converted into machine language with the help of an interpreter a compileran operating systemnone
Ans=b
389.C language has been developed ata) Microsoft corp. USAb) AT & Tbell lab USAc) Borland international USA
Ans= b
390.the expression a=30*1000+2768 evaluates to a) 32768b)-32768c)113040d)0Ans=a
391.the computer language that most closely resembles with the machine language is a)assemblyb) cobolc) fortrand) high level langugeAns= a
392.header file is:a)a file that contains standard library functions.b)a file that contains definition and macrosc)a file that contains user defined functionsd)a file that is present in current working directory.ans393.Real constant in c can be expressed in which of the following forms:
a)fractional form onlyb)exponential form only,c)ascii form onlyd)both a and bans.394.A character variable can never store more than:a)32 charb)255 charc)8 char d)1 charans.395. break statement is used to exit from :a)if statementb)program c)for loopd)main ( ) functionans.396.an integer variable a=5/2 will return value:a)2.5b)2c)3d)0ans.
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 valueANS = c
399. Find out the output void main() { int a="%d"; printf("%d",a); } a . %d b . 25637
c . 37 d . %ANS=a
400.Which of the following statement is false1. Each new C instruction has to be written on a separate line2. Usually all C statements are entered in small case letters3. Blank spaces may be inserted between two words in a C statemernt.4. Blank spaces cannot be inserted within a integer variables.
ANS=a401. 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 definitionANS = d
402. C variable cannot start with 1.An alphapet 2.A number 3.A special symbol 4.Both 2 & 3 aboveans-4403The break statement is used to exit form 1.an if statement 2.a for loop 3.a programme 4.The main ( )functionans-2404.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-3405.The macro FILE is defined in which of the following files 1.stdlib.h 2.stdio.c 3.io.h 4.stdio.hans-2406.Programs stored in which of the following memories cannot be erased 1.RAM 2.ROM
3.Cache memory 4.Virtual memoryans-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 aboveAns : (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 arrayAns : (1)
412. A character variable at a time store a) 1 character b) 8 character c) 254 character d) None of theseAns.) A
413 The break statement is used to exit froma) An if statementb) A loop statementc) A program
d) The main ( ) functionAns.) B
414 In C, Arithmetic instructions cannot containa) Variablesb) Constantsc) 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 functionsb) A file contains definations and macrosc) A file that contains user defined functionsd) A file that is present in current working directingAns.) A
416 Which of these are reasons for using pointersa) To manipulate parts of an arrayb) To refer to key words such as for or itc) To return more than one value from the functiond) To refer to particular programs more convenientlyAns,) 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 = b418.How many main() functions can be defined in a C program(a) 1(b) 2(c) 3(d) any number of timesANS = a
419.A character vriable can at a time store(e) 1 character(f) 8 chatacters(g) 254 characters(h) None of the above
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=b421 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 valueANS = c
424. Find out the output void main() { int a="%d"; printf("%d",a); } a . %d b . 25637 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=a426.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 definitionANS = 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 toA. 32768 B. –32768 C. 113040 D. 0ans.c429 Hierarchy decides which operator
A. is most important B. is used first C.is fastest D. operates on largest numbersCorrect 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.hCorrect ans. D
432.C programs are converted into machine language with the help ofB. interpreter B. compiler C. operating system D. none
Correct ans. B
433. THE BINARY EQUIVALENT OF 5.375 IS –A.101.10111O111B.101.011C.101011D.none of the above.
CORRECT ANSWER- B
434. C LANGUAGE HAS BEEN DEVELOPED BYA) KEN THOMPSON B) DENNIS RITCHE
C) PETER NORTOND) MARTIN RICHARDSANS) DENNIS RITCHE
435. C LANGUAGE HAS BEEN DEVELOPED ATA) MICROSOFT CORP,USAB) AT & T BELL LABS , USAC) BORLAND INTERNATIONAL , USA D) IBM , USAANS) AT & T BELL LABS , USA
436.C LANGUAGE CAME INTO EXISTENCE IN YEARA) 1971B) 1957C) 1972D) 1983ANS) 1983
437.C was developed by a. Wright Brothersb. Charles Babbagec. Albert Einsteind. Dennis Ritchie
ans.d438.Algorithm is
e. used for calculationf. finite sequence of instructionsg. processing datah. none of these
ans.f439.sqrt function is included in which library
i. <stdio.h>j. <conio.h>k. <math.h>l. All of these
ans.k
440.By default any real number is treated as m. a floatn. a doubleo. a long doublep. depending upon the magnitude of number
ans.n441.Which error is displayed if “;” is missing
q. Statement missingr. Declaration missings. No errort. None of these
ans.r
442. Hierarchy decides which operatorC. is most important B. is used first
C.is fastest D. operates on largest numbers
ans. B
443.The macro FILE is defined in which of the following files?A. stdlib.h B. stdio.c C. io.h D. stdio.h
ans. D
444.The option used to get result is…a) printf() b)scanf()
c)clrscr() d) getch()
Ans: d)
445. int is denoted by ……a) “%d” b) “%f” c)”%s”
d)none of these
ans: a)
446.C programs are converted into machine language with the help ofC. interpreter B. compiler C. operating system D. none
ans. B
447.If you don't initialise a static array, what will be the element set to?a.) 0b.) an undetermined value c.) a floating point numberd.) the character cinstant '/0'
ans--a.) 0
448.When you pass an array as an argument to a function,what actually get passed?a.) address of the arrayb.) values of the element of the arrayc.) adress of the first element of the arrayd.) number of the element of the array
ans--a.) address of the array
449.A 32-bit microprocessor can at a time handlea.) 32 bitsb.) 32 bytesc.) 32 kilobytes
d.) 32 megabytes
ans--a.) 32 bits
450.Which of the microprocessor cannot work in Real as well as in Proctected modea.) 80286b.)8088c.)80386d.)80486
ans--b.)8088
451.Which of the following is NOT true about an Operating Systema.) Single userb.) Batch processingc.) Multi userd.) Multi tasking
452.MS-DOS is aa.) Single user operating systemb.) Multi user operating systemc.) Multi tasking operating systemd.) None of the above
453.The option used to get result is…a) printf() b)scanf()
c)clrscr() d) getch()Ans: d) getch()
454.The option used to execute same loop again and again for finite no. of times is….a) then loop b)for loop c)both a & b d)none of theseans: b) for loop
455.int is denoted by ……a) “%d” b) “%f” c)”%s”
d)none of theseans: a) “%d”
456.float is denoted by……..a) “%d” b) “%f” c)”%s”
d)none of theseans: a) “%f”
457.syntax of square root is…….a)sqst() b)clrscr()
c)getch() d)none of these
ans: a)sqst()
458.WHICH OF THE FOLLOWING IS ODD ONE OUT ? a.int b.float c.double d.char (ans.c) 459.WHICH OF FOLLOWING IS SYMBOL FOR 'LOGICAL OR' ? a.&& b.|| c.! d.none of these (ans.b) 500.ALGEBRIC EQUATION (ab/c) IS DENOTED IN 'C' AS.... a.(a*b)-c b.(a*b)/c c.(a*b/c) d.(a*b)+c (ans.b) 501.FUNCTION CAN BE DECLARED AS...... a.local b.global c.local & global d.none of these (ans.c)
502.SYMBOL USED FOR 'FOR' LOOP.... a.rectangle b.parallelogram c.rhombus d.hexagon (ans.d)
503.The option used to clear current window is…a) printf() b)scanf()
c)clrscr() d) getch()Ans: c)clrscr()
504.The option used to execute same loop again and again for finite no. of times is….a) then loop b)for loop c)both a & b d)none of theseans: b) for loop
505.int is denoted by ……a) “%d” b) “%f” c)”%s”
d)none of theseans: a) “%d”
506.Function used to give input to computer is…..a) printf() b)scanf()
c)getch()d) none of these
507.syntax of square root is…….a)sqst() b)clrscr()
c)getch() d)none of theseans: a)sqst()
508. Which of the following is allowed in a C arithmetic instruction-A.[ ] B. { } C.( ) NONE.
509.The expression ,a=30* 1000+2768; evaluates toA. 32768 B. –32768 C. 113040 D. 0
510. Hierarchy decides which operatorD. is most important B. is used first
C.is fastest D. operates on largest numbersCorrect ans. B
511.If u don’t initialize a static array, what will be the elements set to?A. 0 B. an undetermined value
E. a floating pt. no. D. character constant ‘\0’Correct ans. A
512.The macro FILE is defined in which of the following files?A. stdlib.h B. stdio.c C. io.h D. stdio.hCorrect ans. D
513. The macro FILE is defined in which of the following files?1). stdlib.h 2). stdio.c 3). io.h 4). stdio.hans: 4)
514. int is denoted by ……1) “%d” 2) “%f” 3)”%s”
4)none of theseans: 1)
515.THE BINARY EQUIVALENT OF 5.375 IS –1).101.10111O1112).101.0113).1010114).none of the above.
ans: 2)
516. C programs Are converted into machine level language with the help of:
1)Interpreter2)Compiler3)Operating System4)None of theseans: 2)
517. The expression x=4+2%-8 evaluates to:1)-62)63)44)Noneans: 2)
518.C is a ----- level language1.machine level2.high level3.low level4.simple levelAns.2
519.The ‘break’ statement is used to exit from1.an if statement2.a for loop3.a program4.the main( ) functionAns.1
520.A ‘do while’ statement is useful when we want the statement within for loopmust be executed1.at least once2.Only once3.More than once4.None of aboveAns.1
521.What is difference between 5’s in this expression?Int[5]Num[5]1.first is particular element&second isarray size2.first isarray size &second is particular element3.both specify arrays & their sizes4.both specify int type elementsAns.2
522.An array is collection of –1.different datatypes scattered throughout the memory2.same datatypes placed next to each memory3.the same datatypes scattered throuout the memory4.different datatypes placed next to each memeoryAns.3
523.If u don’t initialize a static array, what will be the elements set to?A. 0 B. an undetermined value
F. a floating pt. no. D. character constant ‘\0’Correct ans. A
524.The macro FILE is defined in which of the following files?A. stdlib.h B. stdio.c C. io.h D. stdio.hCorrect ans. D
525.The option used to clear current window is…a) printf() b)scanf()
c)clrscr() d) getch()Ans: c)clrscr()
526.The option used to execute same loop again and again for finite no. of times is….a) then loop b)for loop c)both a & b d)none of theseans: b) for loop
527. int is denoted by ……a) “%d” b) “%f” c)”%s”
d)none of theseans: a) “%d”
528. The smallest element from unsorted sublist and swaps in with element at beginning of unsorted data is found by following sort-(a) bubble (b) exchange (c) insertion (d) quick (e) selectionANS:{a). 529.Which of the following statement is used to terminate a loop prematurely?(a) while (b) for loop (c) continue (d) break (e) do….whileANS:(d).
530.Which of C loops is a pretest loop?(a) do….while (b) for (c) while (d) Both do…while & for (e) Both for & whileANS:(d).
531.Which of the following is not a comparative operator in C?(a) < (b) <= (c) = (d) > (e) >= ANS:(c).
532.Which of the following is not a case sensitive language?(a) COBOL (b) C++ (c) C (d) JAVA (e) LISPANS:{c).
533.which of is top tested loopa)whileb)do whilec)ifd)none
ANS-a)534.which of these is derived data typea)enumeratorb)unionc)structured)array ANS-d)535.array isa)stored in successive memo-locationb)stored in different memo-locationc)stored in scattered memo-locationd)none ANS-a)536.&& is calleda)logical orb)logical notc)logical andd)none ANS-c)537)% representsa)percentageb)remainder after divisionc)multiplicationd)division ANS-b)
538.C programs are converted into machine language with the help of a.An editor b.A compiler c.An operating system d. none
ans:b539.A character variable can at a time store a.one character b.8 characters c.254 character d. noneans:a540.If a is an integer variable,a=5/2; will return a value a.2.5 b.3 c.2 d.0ans:c541.Which of the followig is odd one out a.+ b.- c./ d.** ans:d 542.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
ans:b
543The 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 &bans:a
544.The statement char ch='Z' would store in ch a.The character z b.ASCII value of Z c.Z along with the single inverted commas d.Both 1&2ans:d545.Which of the following shows the correct hierarchy of arithmatic operators in C a.**,* or /,+ or - b.**,*,/,+,- c.**,/,*,+,- d./ or *,- or +ans:a546The break statement is used to exit from: a.An if statement b.A for loop c.A program d.the main( ) functionans:b547.In what sequence the intialisation,testing and execution of body is done in do-while loop a.initialisation,execution of body,testing b.execution of body,initialisation,testing c.initialisation,testing,execution of body d.none of aboveans:c
548.C programmes are converted into machine language with the help of a.A neditor b.A compiler c.An operating system d.None of the above ans.b549.What is a function? a.datatype b.array c.use defined operation d.predefined operation ans.c550.The last chor of every string is a.integer b.chor c.float d.null charans.d551.Which of the following not a high language? a.cobol b.fortran c.assembly d.basic ans.c552 Which of the following is noy a loop of control string a.while b.to c.do while d.for ans.b
553. who developed the ‘c’ langage and when? 1.dennis Ritchie,1920 2.j.l.braid,1968 3.bill gates,1975 4.microsoft companies,1970ans.1)dennis Ritchie,1972554.which section is used to declare different header files used in programme?
1.link section 2.documentation section 3.definition section 4.global declaration sectionans.1)link section555.what is the range of values of “float” type secondary data? 1.-128 to 127 2.-32768 to 32767 3.3.4e-3.8 to 3.4e+38 4.1.7e-308 to 1.7e+308ans.3)3.4e-38 to 3.4e+38556.what is the symbol of logical AND of logical operators? 1.&& 2.!! 3.:: 4.’’ans.1) &&557.how many types of operators are there in “c’? 1.8 2.6 3.10 4.none of aboveans.1)8
558.) This box is represented by
1)input/output2)start/stop3)computation4)sub routine
Ans:-3
559.’c’ is developed by
1)einstien2)Newton3)graham bell4)dennis Ritchie
Ans:-4560.part of function is 1)return type2)paramet list3)body of function4)all of above
Ans:-4
561.‘‘+=’symbol is presented by
1)bitwise or2)bitwiseand3)assign sum4)assignment
Ans:-3562.input and output string can be handled by 1)scanf ( )2)printf()3)%cformat specifier4)all of above
Ans:-4563.syntax for for loop is-- A) for (initialize variable; testing; increment/decrement)B) for (initialize variable; increment/decrement; testing)C) for (initialize variable; testing; increment/decrement); D) for(testing; increment/decrement; initialize variable) ANS) A
564.size of int data type is--A) 1 byteB) 2 byteC) 4 byte D) 8 byteANS) B
565.________ converts C language into binary language--A) interpreterB) compilerC) assemblerD)LinkerANS) B
566. output of following program---main(){int a=5;float b=2.0;a/=b;printf(“%d”,a);getch();}
A) 2.5B) 3C) 2D) errorANS) C
567. C was developed by Denis R. at- a) Microsoft lab b) AT & T lab c) Infosys lab
d) Cognizant labAns. AT & T lab568. Every C program is terminated by- a) stdio.h b) conio.h c) getch ( ) d) void main Ans. getch ( )569.When was C language developed? a) 1972 b) 1982 c) 1992 d) 1962Ans. 1972570.What is symbol for logical and? a) !! b) && c) ! d) _ _Ans. && 571.How many types of operators are there in C ? a) 5 b) 6 c) 7 d) 8Ans. 8
573.denis ricthie developed c language ina) 1972b) 1974c) 1970d) 1971Ans:- a
573.which is top tested loop a)while b)do while c)if d)noneans:- a
574.printf is used for a)printing input b)printing output c)scaning i/p d)scaning o/pans:-a
575which is not is a header file
a)stdio.h b)conio.h c)math.h d)pco.hans:- d
576)how many ( ) functions can be defined in c language a)1 b)2 c)3 d)4ans:- a