You are on page 1of 15

INFIQUE CLASSES JAIPUR

S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

A.S is an illegal name for a string s


B."12345"
C.nothing since 12345 is an integer
D.%s cannot be used for reading in values of S.
Q 5. What would be the output of the following
pro-gram if input to the program is 'e'? / यकद
प्रोग्राम का इनपुट 'e' है तो डनम्नडलडित प्रोग्राम का
आउटपुट क्या होगा?
main () { int lower, upper; upper = getchar() ;
upper = toupper(lower); putchar(upper); }
A.53 B.e
C.E D.nothing
Q 6. Identify the most appropriate sentence to
describe Unions /
Unionsकािणिनकरनेकेडलएसबसेउडचतिाक्यकीपहचानक
रें
A.Unions contain members of different data types
Q 1. The conditional operator (?) is also known as which share the same storage area in
/ कं डिशनलऑपरे टर(?) कोइसरूपमेंभीजानाजाताहै memory
A.control operator B. loop operator B.Unions are used for set operations
C. case operator D. ternary operator C.Unions are less frequently used in programs
D.Unions are like structures
Q 2. C' & 'C++ languages are the example of / 'C'
Q 7. 1: typedef long a; extern int a c;
और 'C++" भाषाएं के उदाहरण है-
2: typedef long a; extern a int c;
A.Second Generation Programming Languages
3: typedef long a; extern a c;
B.First Generation Programming Languages
A.2 Correct B.1 Correct
C.Third Generation Programming Languages
C.3 Correct D.1,2,3 are Correct
D.Fourth Generation Programming Languages
Q 8. The strategy of allowing processes that are
Q 3. Which of the following statements is used to
logically runnable to be temporarily suspended is
make a selection from more than two choices / दो
called: / logically runnable प्रकियाओं को अस्थायी रूप
से अडिक डिकल्पों में से चयन करने के डलए डनम्नडलडित
से suspended करने की अनुमडत देने की रणनीडत
में से ककस कथनका प्रयोग ककया जाता है?
कहलाती है:
A.switch B.if-else
A.non preemptive scheduling
C.else-if D.None of these
B.preemptive scheduling
Q 4. It S is an array of 80 characters, then the C.shortest job first
value assigned to S through the statement D.first come first served
scanf("%s", S) with input 12345, will be :/ यह S 80
Q 9. Which of the following 'C' type is not a primi-
िणों की एक सरणी है, तो S को कदए गए मान को 12345
इनपुट के साथ स्टेटमेंट scanf("%s", S) के माध्यम से tive data structure? / डनम्नडलडितमेंसेकौन-
डनर्दिष्ट ककया जाएगा: सा'C'प्रकारडप्रडमटटििेटास्रक्चरनहींहै?

Page 1 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

A.int B.float for(i =1; i<5; i + =3) {} printf(“%d”, i);


C.char D.none of the above A.4 B.1
C.7 D.syntax error
Q 10. The getch() library function: / getch()
लाइब्रेरी फं क्शन: Q 16. The && and operators:
A.returns a character when enter is pressed A.Compare two numeric values
B.returns and displays a character on the screen B.Combine two numeric values
when any key is pressed C.Compare two Boolean values
C.returns a character when any key is pressed D.perform none of the above
D. none of the above Q 17. A structure brings together a group of : /
एक structure एक group को एक साथ लाती है
Q 11. The library function exit ( ) causes an exit
A.related data items and variables
from: / लाइब्रेरी फं क्शन exit( ) से बाहर डनकलने का
B.integers with user defined names
कारण बनता है:
A.the block in which, it occurs C.items of the same data type
B.the functions in which, it occurs D.None of these
C.the loop in which, it occurs Q 18. Consider the following program: /
D.None of these डनम्नडलडित प्रोग्राम पर डिचार करें :
Q 12. What is the output of the following C Main (){ int c = 50; for (; c ;) c --; printf(“%d\n” , c);
program code? / डनम्नडलडित सी प्रोग्राम कोि का } The output of the program will be:
आउटपुट क्या है? A.50 B.-50
inti=0; for(;i<= 5; i++); printf("%d", i); C.0 D.None of these
A.6 B.0,1,2,4,5
Q 19. The break statement causes an exit: /ब्रेक
C.5 D.1,2,3,4,5
स्टेटमेंट एक exit का कारण बनता है:
Q 13. A default argument has a value that:/ एक A.only from the innermost loop
default आगुिमेंट का एक मान होता है जो: B.only from the innermost switch
A.integers with user defined names C.from the innermost loop or switch
B.may be supplied by the calling program or D. None of the above
function Q 20. In which stage the following code
C. related data items and variables # include <stdio.h>gets replaced by the contents
D.None of these
of the file stdio.h/डनम्नडलडित कोि ककस चरण
Q 14. Which of the following is a collection of मेंफाइल stdio.hकी सामग्री द्वाराप्रडतस्थाडपत हो जाता है
different elements having similar data type? / A.During linking B.During editing
डनम्नडलडित में से कौन सा समान िेटा प्रकार िाले डिडभन्न C.During execution D.During Preprocessing
एडलमेंट्स का संग्रह है?
Q 21. Consider the following program /डनम्नडलडित
A.Structure B.Array
कायििम पर डिचार करें
C.Union D.Pointer
main()
Q 15. What is the output of the following C {
program code? / डनम्नडलडित सी प्रोग्राम कोि का int x = 0, i, j; for ( i = 0 , j=10; i< 5, j > 0;i +=2, J--)
आउटपुट क्या है? ++ x; printf("%d",x);

Page 2 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

} The output of the above program will be: Q 27. Which of the following statements about
A.0 B.10 High Level language is correct? / उच्च-स्तरीय भाषा
C.5 D. None of the above के सम्बन्ि में डनम्नडलडित में से कौन-सा कथन सही है?
Q 22. #define preprocessor command can be for A.High Level language is machine independent
defining: /# define प्रीप्रोसेसर कमांि का उपयोग ककया B.High Level language is machine dependent
जा सकता है। C.High-Level language is difficult than Assembly
A.macros B.symbolic constants D.High-Level language programs require
C.for loop D.both (1) and (3) Assembler.
Q 23. Enumeration variables can be used in: Q 28. In which header file is the NULL macro de-
/enumerationिेटरएबलका उपयोग इस प्रकार ककया जा fined?/ ककस हेिर फाइल में NULL मैिो को पटरभाडषत
सकता है: ककया गया है?
A.preprocessor commands A.stddef.h B.stdio.h
B.search statement like a integer variable C.stdio.h and stddef.h D.stdlib.h
C.break statement
Q 29. What is (Void*) 0? / (Void*) 0 क्या है?
D.All of the above
A.Represented of void pointer void
Q 24. Which of the following is a pointer variable B.Represented of NULL pointer NULL
in C? /डनम्नडलडित में से कौन Cमें पॉइं टर िेटरएबल है? C.Error
A.Char P; B.int P; D.None of the above
C.int * P; D.int& P; Q 30. Which of the following operators takes only
Q 25. What will happen if in a C program you integer operands?/डनम्नडलडित में से कौन सा ऑपरे टर
assign a value to an array element whose के िल इडन्टजर ऑपरें ि लेता है?
subscript ex-ceeds the size of array?/क्या होगा यकद A.* B.+
एक सी प्रोग्राम में आप एक ऐरे एडलमेंट के डलए मान C./ D.%
डनर्दिष्ट करते हैं डजसका सबडस्िप्ट ऐरे के आकार को Q 31. The value of an automatic variable that is
exceeds करता है? de- cleared but not initialized will be: /एक
A.The compiler would report an error ऑटोमैटटक िेटरएबल का मान जो िी-डक्लयरि है लेककन
B.The element will be set to 0.
इडनडशयलाइज़ नहीं होगा:
C.The program may crash if some important data
A.-1 B.0
gets over- written
C.Unpredictable D.None of the above
D.The array size would appropriately grow
Q 32. In the programming language C: /प्रोग्राममंग
Q 26. In C, if you pass an array as an argument to
भाषा 'सी' में:
afunction, what actually gets passed? / C में, यकद
A.blanks can be given within a variable name
आप ककसी फं क्शन के तकि के रूप में ऐरे पास करते हैं, तो
B.variable names are case-sensitive
िास्ति में क्या पास हो जाता है? C.there are no reserved words, which are not
A.First element of the array allowed as variable names
B.Value of elements in array D.None of the above
C.Base address of the array
D.Address of the last element of array
Page 3 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

Q 33. Length of the string "correct" is: /"Correct" Q 38. Consider the following program
मस्रंग की लम्बाई है: fragment:/डनम्नडलडित प्रोग्राम िण्ि (fragment ) पर
A.8 B.7 डिचार करें :
C.6 Main()
D.Implementation dependent { int a, b, c; b= 2; a= 2* (b++); c = 2* (++b); }
Q 34. A diamond-shaped box in a flow chart Which one of the given answer is correct? / डनम्न में
refers to: /फ्लो चाटि में िायमंि के आकार का बॉक्स से कौन एक सही है?
संदर्भित करता है: A.a=3, c=8 B.a=4, c=6
A.printing of a file C.b=3, c=6 D.a=4, c=8
B.data input from a device Q 39. It is necessary to declare the type of a
C.an if-then-else decision function in the calling program if: /यकद कॉमलंग
D.an assignment statement (calling) प्रोग्राम में function के प्रकार की घोषणा
Q 35. The include directive in C is used to: / C में करनाआिश्यकहोताहै
include िायरे डक्टि का उपयोग इसके डलए ककया जाता A.the function returns a non-integer value
है: B.the function returns an integer
A.include header files in a program C.the function is not defined in the same file
B.specify a list of files from where data will be D.None of the above
read at the time of execution Q 40. What will be the value of the sum after the
C.link other object modules to the current following program is executed?/डनम्नडलडित प्रोग्राम
program at the time of compilation के execute होने के बाद sum का मूल्य क्या होगा?
D.None of the above { int sum, index, sum = 1; index = 9;
Q 36. Which one of the following statements is Do { index = index-1; sum=2*sum; }
true after execution of the program/प्रोग्राम के While (index>9); }
एक्सेक्यूशन के बाद डनम्नडलडित में से कौन सा कथन सत्य A.2 B.1
C.9 D.0.5
है
int a[10], I, *p; Q 41. Given the following program fragment,
a[0] = 1; a[1] = 2; p = a; which one of the alternatives is correct?
(*p)++; /डनम्नडलडित प्रोग्राम िंि को देिते हुए, डिकल्पों में से
A.a[1] = 3 B.a[0] = 3 कौन सा सही है?
C.a[1] = 2 D.all {char status; int balance; balance= 1000; status =
Q 37. Which one of the following violates the (balance>= 1000)? 'C': '0' ; }
principles of structured programming? / A.status = 'C' B.status = '0'
डनम्नडलडित में से कौन सा स्रक्चिि प्रोग्राममंग के डसद्ांतों C.status = 0; D.status = NIL
का उल्लंघन करता है? Q 42. What is the final value of digit? / अंक का
A.The use of "go to" statements in a program अंडतम मान क्या है?
B.The use of "do while" statements main()
C.The use of global variables { int digit;
D.The use of recursive procedures for ( digit = 0 ; digit < = 9; ++digit)

Page 4 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

printf ("%d\n", digit); { case ‘R’: printf("RED");


digit= 2*digit; --digit; } case ‘W’: printf("WHITE"); case 'B’: printf("BLUE");
A.-1 B.19 default: printf("ERROR"); break; }
C.17 D.16 What would be the output if choice = ‘R’? / यकद
Q 43. How many times will the print statement be चॉइस = 'R' हो तो आउटपुट क्या होगा?
executed? / मप्रंट स्टेटमेंट को ककतनी बार एक्जीक्यूट A.RED ERROR
ककया जाएगा? B.RED
main() C.RED WHITE BLUE ERROR
{ int n; n = 10; while (n < 10) { printf ("hello" ); --n; D.RED WHITE BLUE
}} Q 48. What is the following function
A.once B.never computing?/डनम्नडलडित फं क्शन कं प्यूटटंग क्या है?
C.10 D.9 test (n) int n; { inti; long int prod = 1;
Q 44. What is the following program if (n> 1) for (i = 2; i< = n;i++) prod*= i;
doing?/डनम्नडलडित प्रोग्राम क्या कर रहा है? return(prod); }
main() A.It calculates the value of factorial n
{ int digit = 0; do B.It checks whether n is a non-negative integer
printf("%d\n" , digit++); while (digit< = 9); C.It calculates the product to any n positive
A.Adding integers from 1 to 9 integers
B.Adding 9 integer D.None of these
C.Displaying any 9 integers Q 49. How many times, will the following loop be
D.Displaying integers from 1 to 9 executed? / डनम्नडलडित लूप को ककतनी बार डनष्पाकदत
Q 45. The following program fragment: ककया जाएगा?
{ int sum, index; index = 50; while(index >= 0 ) c1 = 'a';
{ sum = sum/index; - index; while (c1 >= 'a'&& c1 <= ‘z’) { c1 ++; }
}} A.26 B.0
A.will give a compilation error C.25 D.1
B.will give a run time error Q 50. What would be the value of c? / cका मान
C.will give a linking error क्या होगा?
D.None of the above { int c; float a, b; a = 245.05; b= 40.02;
Q 46. What will be the output of the following c=a+b; }
pro-gram fragment?/डनम्नडलडित प्रोग्राम िण्ि A.285.07 B.285.0
C.2850 D.285
(fragment) का output क्या होगा?
{ inti = 12345; float x = 145.678 ; Q 51. What will be the output of the following
print("%3d, %5d, %8d”, i, i, i); } program?/ कदये गये प्रोग्राम का आउटपुट क्या होगा?
A.12345 12345 12345 B.123 { inti = 1234; j = 0177, k = 0xa08c;
C.12345 D.123 123 123 printf(“%8dx\n",i, j, k); }
Q 47. Consider the program fragment A.0000 1234 01aa ax B.1234 1777 a08c
switch (choice) C.1234 1abc a08c D.1234 0777 a080

Page 5 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

Q 52. if (i>1) c = 2; else c = 3; switch (3) Q 57. In C++ a function contained within a class is
{ case 2: printf("CAUTION"); break; called: / C++ में एक क्लास के भीतर डनडहत एक फं क्शन
case 3: printf("GOOD BYE"); break; कहा जाता है?
default: printf("ERROR"); } A.A class functions B.Member function
What is the output if i = 3? / यकद i=3 हो तो आउटपुट C.An operator D.A method
क्या होगा?
Q 58. If switch feature is used, then: / यकद डस्िच
A.ERROR B.CAUTION
सुडििा का प्रयोग ककया जाता है, तब
C.GOOD BYE D.default
A.default case, if used, should be the last case
Q 53. How many times will the following loop be B.default case must be present
executed? / कदया गया लूप ककतनी बार डनष्पाकदत C.'default' case, if use, can be placed anywhere
होगा? D.none of the above
{ x=5; if ( x = 1 ) { : x++; } Q 59. Which of the following might be output as
A.Never B.Once
result of using a CASE tool? / CASE टू ल का उपयोग
C.Five times D.Infinitely many times
करने के पटरणामस्िरूप डनम्न में से कौन सा आउटपुट हो
Q 54. Which of the following statement is not सकता है?
true in context of strings in C language?/ C लैग्िेज A.Flowcharts and data flow diagrams
में strings के सन्दभि में डनम्न में से कौन-सा कथन सत्य B.Programmable Code
नहीं है? C.Prototypes and Cost / benefit analysis
A.Last character of character array is always '/o' D.All of the above
B.It is array of characters Q 60. Choose the correct answers :
C.C inserts the null character automatically A.Nested for loop may use the same index
D.Any string in C can be read by the B.for loops can be nested
functiongetchar() C.Both of the above
D.None of the above
Q 55. What is the value of u1and u2?/u1and u2का
मान क्या है? Q 61. Which of the following comments about for
int u1, u2; int v=3; int *pv; u1 = 2*(v+5); loop are correct?/ लूप के बारे में डनम्नडलडित में से
pv= &v; u2= 2*(*pv+5); कौन-सी टटप्पडणयााँ सही है?
A.u1=16, u2=3 B.u1=16, u2=16 A.Index value can be changed from within the
C.u1=8, u2=16 D.u1=8, u2=3 loop
Q 56. Which of the following statement is false B.Index value is retained outside the loop
C.goto can be used to jump, out of the loop
context of constructors in C++? / डनम्नडलडित में से
D.All of the above
कौन सा कथन C++ में कं स्रक्टसि का गलत संदभि है
A.Its name is the same as the class name Q 62. Which of the following concepts can be
B.A constructor is a special member function usedto identify loops? / लूप की पहचान करने के डलए
whosetask is to initialize the objects of its class डनम्नडलडित में से कौन-सी
C.The constructor is invoked whenever an object अििारणाओंउपयोगककयाजासकताहै?
ofits as associated class is created A.Reducible graphs B.Dominators
D.It is also used to destroy the objects C.Depth first ordering D.All of the above
Page 6 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

Q 63. In a for loop if the condition is missing, then B.The finalise () method will eventually be called
infinite looping can be avoided by a: / लूप के डलए on every object finalise ()
यकद कं िीशन गायब है, तो इनकफडनट लूमपंग से बचा जा C.The finalize() method will never be called more
than once on an object
सकता है:
D.The garbage collector will use a mark and
A.break statement B.goto statement
C.return statement D.all of the above sweep algorithm.

Q 64. Pick the correct answers: / सही उत्तर का Q 69. In C, strings are stored in a/an: / C में, मस्रंग्स
चुनाि करें : को a/an में संग्रडहत ककया जाता है:
A.Array definition precedes array declaration A.linked list of characters
B.During array declaration, no storage is set aside B.linked list of unsigned characters
C.Array declaration precedes array definition C.array of characters
D.Both A and B only are correct D.array of integers

Q 65. Initialization cannot be a part of the Q 70. Which of the following are unary operators
definition if the storage class of the array is: / in C? / डनम्नडलडित में से कौन C में यूनरी ऑपरे टर हैं?
initialization िेकफडनशन का डहस्सा नहीं हो सकता है 1. 2. Size of
3. ~ 4. &&
यकद ऐरे का स्टोरे ज क्लास है:
A.1,3 B.1,2
A.external B.static
C.2,4 D.1,2,3
C.automatic D. None of the above
Q 71. Which operators will always evaluate all the
Q 66. In C, it is best to implement chained hash
operands? / कौन से ऑपरे टर हमेशा सभी ऑपरें ि का
tableas an array of: / सी में, chained हैश टेबल को
मूल्यांकन करें ग?े
एक ऐरे के रूप में लागू करना सबसे अच्छा है:
A.+ B.&&
A.string B.structures
C.|| D.? :
C.pointers D.None of these
Q 72. In which order do the following gets
Q 67. Dynamicstorage allocations cannot be used
evaluated:/ डनम्नडलडित िम में मूल्यांकन ककया जाता है
in C without: / िायनेडमक स्टोरे ज आिंटन का उपयोग C
1. Relational 2. Arithmetic
में इसके डबना नहीं ककया जा सकता है:
3. Logical 4. Assignment
A.unions B.Files
A.1,2,3,4 B.2,1,3,4
C.pointers D.enumerated data types
C.4,3,2,1 D.3,1,2,4
Q 68. Which statements describe guaranteed
Q 73. Find out the error in the following program:
behavior of the garbage collection and finalization
/ डनम्नडलडित प्रोग्राम में त्रुटट का पता लगाए
mechanisms? / कौन से कथन garbage कलेक्शन और
main()
अंडतम रूप देने के तंत्र के गारं टीकृ त व्यिहार का िणिन
{ int mark; char grade;
करते हैं? switch (mark) { case 5: grade = 'A'; break; case 4;
Select all the valid answers /सभी िैि उत्तरों का grade = 'B'; break; case 4; grade = 'B’; break;
चयन का चयन करो default; grade = 'C’; break; } / *switch* / }
A.Objects are deleted when they can do longer be A.switch statement cannot have more than three
accessed through any reference labels

Page 7 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

B.case labels cannot be numbers B.WEST


C.No two labels may be identical C.WEST NORTH SOUTH
D.None of these D.Syntax error because default case is missing
Q 74. #define dp (e) printf ( #e “ = %\n” ,e ) Q 79. Data type of the controlling statement of a
main ( ) SWITCH statement cannot of the type : /डस्िच
{ int x = 3, y = 2; dp(x / y) } स्टेटमेंट के कं रोमलंग स्टेटमेंट का िेटा टाइप इस प्रकार का
What will be the output of the program? /प्रोग्राम नहीं हो सकता है:
का आउटपुट क्या होगा? A.char B.int
A.prints #e = 1.5 B.prints x/y = 1 C.short D.float
C.prints #x/y = 1 D. None of the above
Q 80. By default a real number is treated as a: /
Q 75. Specify the 2 library functions to डिफाल्ट रूप से एक िास्तडिक संख्या के रूप में माना
dynamically allocate memory? / मेमोरी को जाता है-
िायनाडमक रूप से आिंटटत करने के डलए 2 लाइब्रेरी
A.double B.float
फं क्शन्स को डनर्दिष्ट करें ? C.long double D.integer
A.alloc() and memalloc()
Q 81. What will be the output of the following
B.malloc() and memalloc()
C.malploc() and calloc() program? / डनम्नडलडित प्रोग्राम का आउटपुट क्या
D.memalloc() and faralloc() होगा?
main()
Q 76. To read and write an existing file without
{ int a; printf("%d", a); }
overwriting, the following mode is used. / ककसी
A.1 B.0
मौजूदा फाइल को डबना ओिर राइटटंग के पढ़ने और C.Error D.Unpredictable Value
डलिने के डलए डनम्न मोि का उपयोग ककया जाता है-
Q 82. Function putchar () displays : / Function
A.w B.r
putchar () प्रदर्शित करता है।
C.r+ D.w+
A.one character at a time
Q 77. When accessing a structure member, /the B.One word at a time on the screen
identifier to the left of the dot operator the name C.result on the screen
of: / एक स्रक्चर मेंबर तक पहुाँचने पर, / िॉट ऑपरे टर के D.None of the above
बाईं ओर आइिेंटटफायर का नाम:
Q 83. ATM header is: / ATM हेिर है-
A.a structure tag B.a structure member
A.15 byte B.48 byte
C.a structure variable D.the keyword struct
C.5 byte D.24 byte
Q 78. What is the effect of the following code? /
Q 84. The keyword struct and class differ in C++
डनम्नडलडित कोि का प्रभाि क्या है?
context- / C++ में कीिििstruct और क्लास डभन्न होता
main ()
है-
{ int option = 4; switch(option/2)
A.Structcan not have member functions where as
{ case 1: printf ("EAST"); case 2: printf ("WEST");
a class can have
case 3: printf("NORTH"); case 4: printf ("SOUTH");
B.struct is used in C where as class in used in C++
}}
A.Syntax error because break is missing

Page 8 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

C.Struct has default public, class has default C.LOC(Array[5]) = Base (array[4]) + (5-Upper
private bound),where w is the number of words per
D.All of the above memory cell for the array
Q 85. How many times "INDIA" will get printed? / D.None of the above
"INDIA" को ककतनी बार मप्रंट ककया जाएगा? Q 89. Using goto inside for loop is equivalent to
#include<stdio.h> using: / लूप के अंदर goto का उपयोग करना उपयोग
int main() करने के बराबर है:
{ int x; A.break B.continue
for (x = -1;x <= 10; x++) { if(x < 5) continue; else C.return D.none of the above
break;
Q 90. break statement can be simulated by
printf("INDIA")}
using:/ ब्रेक स्टेटमेंट का उपयोग करके अनुकरण ककया जा
Return 0: }
सकता है-
A.11 times B.Infinite times
A.return B.goto
C.0 times D.10 times
C.exit
Q 86. An error in the program logic can be D.any to the above features
detected: / प्रोग्राम लॉडजक में गलती को पता लगाया
Q 91. An algorithm is best described as: / एक
जा सकता है-
एल्गोटरदम को सबसे अच्छा िर्णित ककया गया है:
A.by the compiler
A.a step-by-step procedure for solving a problem
B.by the operating system
B.a branch of mathematics
C.during execution of the program
C.a computer language
D.None of the above
D.None of these
Q 87. Which one of the following is not a basic
Q 92. Which type of errors is flagged by
data type in C? / डनम्न में से कौन C में एक बेडसक िेटा
compliers? / Compilers द्वारा ककस प्रकार की त्रुटटयों
टाइप नहीं है-
को डचडननत ककया जाता है?
A.Complex B.Integer
A.Logical errors B.Run-time errors
C.Character D.None of these
C.Syntax errors D.None of the above
Q 88. The memory address of fifth element of an
Q 93. The following program fragment /
array can be calculated by the formula: / ऐरे के
डनम्नडलडित प्रोग्राम िंि
पांचिें एडलमेंट का मेमोरी एड्रेस सूत्र द्वारा गणना की जा
int a = 4, b = 6; printf("%d", a = = b);
सकती है
A.prints 0
A.LOC(Array[5]) = Base (Array[5]+ (5-lower
B.outputs an error message
bound),where w is the number of words per
C.print 1
memory cell forthe array.
D.None of the above
B.LOC (Array[5] = Base (Array) + w(5-lower
bound), where w is the number of words per Q 94. Bug means: / बग का अथि है:
memory cell for the array. A.A difficult syntax error in a program
B.A logical error in a program

Page 9 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

C.Documenting programs using an efficient C.syntax error D.None of the above


documentation tool Q 101. What will be the output of the following
D.None of these
codesegment? / डनम्नडलडित कोि िण्ि का आउटपुट
Q 95. For (i = 1; i< 5; ++i) if (i == 3) continue; क्या होगा?
else int a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },
printf("%d", i); results in the printing of: *p= a; print ("n\%d", p[7], p[a[7]]);
A.124 B.1245 A.7:8 B.7:7
C.245 D.none of the above C.8:9 D.8:8
Q 96. Any transcription error can be repaired by:/ Q 102. Output of the following program will be:
ककसी भी रांसकिप्शन त्रुटट टरपेयर डनम्न द्वारा की जा main ()
सकती है: { int a[] = {1, 2, 9, 8, 6, 3, 5, 7, 8, 9 };
A.deletion alone B.insertion alone int *p = a + 1; int *q= a+ 6;
C.insertion and deletion alone printf("\n&d", q- p); }
D.replacement alone A.5 B.9
Q 97. Size of return operator bytes are depend C.2 D.None of the above
upon:/ टरटनि ऑपरे टर बाइट्स का आकार डनभिर करता है Q 103. What will be the output of the following
A.type B.identifier code? डनम्नडलडित कोि का आउटपुट क्या होगा?
C.identifier or type D.array void fun (int a[ ], int a)
Q 98. The following loop { a[0] = a [2]+a[2]; a[2] = a[0]+a[0]; a[1] = a [1]+a,
for ( i = 1, j = 10 ;i< 6; ++ i, - - j ) a[3] = a[3]*a[3]; }
print("%d %d", i,j); main ()
{ int n[]={5, 3, 2, 1}, size = 4; fun (n, size);
sprintsमप्रंट करता है-
printf ("%d %d %d %d", n, n[1], n[2], n[3]);}
A.12345109876 B.11029384756
A.syntax error B.5321
C.1111199999 D.None of these
C.5781 D.4781
Q 99. Given the piece of code/ कदया गया कोि िण्ि
Q 104. Which of the following is not a basic data
Inta [50]; int *pa; pa = a;
typeused in C language? / डनम्न में से कौन सा 'C'
To access the 6 ^ (th) element of thearray which
लैंग्िेज में एक बेडसक िाटा प्रकार के रूप में प्रयुक्त
of the following is incorrect?/ऐरे के 6^(िें) एडलमेंट
नहींहोता?
तक पहुाँचने के डलए डनम्न में से कौन सा गलत है?
A.float B.double
A.a[5] B.*(a+5)
C.Char D.array
C.pa[5] D.*(*pa+5)
Q 105. If a variable is a pointer to a structure,
Q 100. Consider the following program:
then which of the following operator is used to
main ()
accessdata member of the structure through the
{ char *k = xyz ; f(k);
printf ("%s \n",k); } pointer variable. / यकद ककसी structure में variable
f (char *k) { k = malloc (4); strcpy(k, "pq”); } एक प्िाइं टर हो, तो कौन से ऑपरे टर का प्रयोग प्िाइं टर
What will be the output? variable द्वारा structure के िाटा मेंबर को एक्सेस करने
A.xyz B.pq हेतु ककया जाता है?

Page 10 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

A.'&' B.‘ ’ Q 112. Consider the following code segment:In


C.‘*’ D.‘->’ order to sum all the odd numbers between 1 to
Q 106. How many times is a do while loop 100; which of the following statements cannot
guaranteedto loop?/ do while loop ककतनी बार replace ***? / 1 to 100 तक के बीच के सभी डिषम
ककसी लूप को आश्वस्त करता है संख्याओं के योग के सन्दभि में कौन-सा कथन प्रडतस्थाडपत
A.Infinitely B.0 नहीं ककया जा सकता?
C.1 D.Variable for (odd_sum =0,j=1; ***; j+= 2 odd_sum +=j;
A.< 99 B.< = 99
Q 107. What does fp point to in the program?/
C.< = 100 D.< 100
प्रोग्राम में fpप्िाइं ट क्या सूडचत करता है?
#include<stdio.h> Q 113. What will be the output of the following
int main() program / डनम्नडलडित प्रोग्राम का आउटपुट क्या होगा?
{ FILE *fp; Main ()
fp = fopen("trial", r); { intval = 500; int *ptr = &val;
return 0; } printf ("val = %d", **ptr1); }
A.A structure which contains a char pointerpoints A.address of ptr B.500
to the first character of a file C.contents of ptr D.none of the above
B.The first character in the file Q 114. Size of the following union (assume size of
C.The name of the file int = 2; size of float = 4 and size of char = 1);
D.The last character in the file union Jabb { int a; float b; char c; };
Q 108. What is this operator called>>/ >>ऑपरे टर A.4 B.2
C.1 D.7
कहलाता है
A.Extraction operator B.Insertion operator Q 115. Find the error in the following program:
C.Assignment Operator D.All of the above main ()
{ int m; char g; switch (m)
Q 109. In C language. % Id is used as the format
{ case 5: grade="P" break; case 2: grade="Q"
of....... data type:/ C भाषा में % Id को िेटा प्रकार के
break; case 2: grade="R" break; default: grade =
रूप में उपयोग ककया जाता है-
"S"break; }}
A.long int B.int
A.switch statement cannot have more than three
C.double int D.long distance
labels
Q 110. The rule for implicit type conversion in 'C' B.No two labels may be identical
is: / 'सी' में implicit प्रकार के कन्िशिन का डनयम है: C.case label cannot be numbers
A.unsigned <int< float <double D.none of the above
B.int< unsigned < float < double Q 116. Which of the following statement is
C.int<unsigned < double < float
correct about the following program? / डनम्नडलडित
D.unsigned <int< double < float
प्रोग्राम के सन्दभि में कौन-सा कथन सही है
Q 111. C function returns....... value by default:/ #include <stdio.h> long fun (intnum) { inti; long f =
सी फं क्शन डिफॉल्ट रूप से ...... मान लौटाता है: 1; for (i = 1; I <= num; i++ ) f = f*1; return f; }
A.No B.Character
C. Integer D. Float
Page 11 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

A.The function calculates the square root of an A.float B.void


integer. C. Integer D.none of these
B.The function calculates the value of 1 raised to Q 123. In C language, conditional operator is also
power num.
called as: / C भाषा में, कं डिशनल ऑपरे टर को इस प्रकार
C.The function calculates the factorial value of an
भी कहा जाता है:
integer
A.unary operator B.logical operator
D.None of the above
C.ternary operator D.binary operator
Q 117. What is the output of the following
Q 124. In C, if you pass an array as an argument
code?/ डनम्नडलडित कोि का आउटपुट क्या होगा?
to a function, what actually gets passed? / C में,
main ()
यकद आप ककसी फं क्शन के आगुम
ि ेंट के रूप में ऐरे पास
int a =1, b=10; swap (a, b);
printf ("\n %d", a, b); } swap (int x, int y) करते हैं, तो िास्ति में क्या पाटरत हो जाता है?
{ int temp; temp = x; x= y; y= temp; } A.First element of the array
A.110 B.11 B.Value of elements in array
C.101 D.None of the above C.Base address of the array
D.Address of the last element of array
Q 118. The do ….. while looping statement. / The
Q 125. Which of the following directive creates
do ….. while लूमपंग स्टेटमेंट
A.is also known as entry controlled loop functions like macros? / डनम्नडलडित में से कौन सा
B.is executed only once if the condition is true िायरे डक्टि मैिोज़ जैसे फं क्शन्स का डनमािण करता है?
C.is executed at least once if the condition is false A.#define B.#include
D.is unconditional looping statement C.#undef D.#ifdef

Q 119. Pow(x,y) is used to / pow(x,y) का प्रयोग Q 126. The sqrt() function is available in: / sqrt()
ककया जाता है फं क्शन उपलब्ि है:
A.power of xy A.string.h B.conio.h
B.power of yx C.math.h D.graphic.h
C.logarithm of x on the base y Q 127. What is the value of r after this code is
D.such function does not exist executed? / इस कोि के डनष्पाकदत होने के बाद r का
Q 120. Which of the following is not a header file मान क्या है?
of C?/ डनम्न में से कौनसी C की हेिर फाइल नहीं है? r=2; k=8; if (r>3 || k>6 && r<5 || k>10)
A.String.h B.Ctype.h r=9; else r=6;
C.Stdlib.h D.type.h A.2 B.9
C.6 D.8
Q 121. Which one of the following is valid in C
language? / डनम्नडलडित में से कौन C भाषा में मान्य है? Q 128. Which of the following cannot be used as
A.float n, a[n]; B.printf(“%d”, ++4) identifiers? / डनम्नडलडित में से कौन सा identifiers के
C.int *p = &a, a=3 D.for(; ;); रूप में उपयोग नहीं ककया जा सकता है?
A.Digits B.Spaces
Q 122. By default the return type of any user
C.Underscores D.Letters
defined function in ‘C’ is : / डिफॉल्ट रूप से 'सी' में
ककसी यूजर डिफाइं िफं क्शन का टरटनि प्रकार है:

Page 12 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

Q 129. The result of a Relational operation is Q 134. Which of the following is a Lex operator?
always. / टरलेशनल ऑपरे शन का पटरणाम हमेशा होता / डनम्न में से कौन सा लेक्स ऑपरे टर है?
है। A.|OR B. *
A.is less than or is more than C.+ D. All of these
B.either true or false Q 135. The symbol <<
C.is equal or less or more A.is called output operator
D.All of the above B.is called insertion operation
Q 130. How many times the printf statement C.is called extraction operator
within the while loop will be executed? / ककतनी D.both a and b
बार लूप के भीतर printf स्टेटमेंट को डनष्पाकदत ककया Q 136. Which of the following are valid character
जाएगा? constants? / डनम्नडलडित में से कौन से िैि character
x=1; while(x=0) constants हैं?
printf("Hello"); A.'11' B.'1n'
A.0 B.1 C.'10' D.All of the above
C.infinite D.2
Q 137. Finalizer()?
Q 131. What will be the output of the following A. finalizer method is represented as finalize()
code? / डनम्नडलडित कोि का आउटपुट क्या होगा? B. Finalizer () are called just before the object is
main() garbage collected, and its memory is reclaimed
{ int a, b; a=3%4; switch (a/1) C. Finalize() can be overridden
{ default : printf ("I"); case3 : printf("T"); case2: D. All of the above
printf("w"); case1: printf("o"); }} Q 138. What is the missing statement in the
A.Two B. ITWO following function which copies string x into string
C. Syntax error because break is missing
y? / डनम्नडलडित फं क्शन में डममसंग स्टेटमेंट क्या है जो
D. Syntax error because default is misplaced
मस्रंग x को मस्रंग y में कॉपी करता है?
Q 132. In C programming language, which of the Void strcpy(char * x, char * y )
following operators has the highest precedence? / { while (*y = '\0')...........\* missing statement */*x
C प्रोग्राममंग लैंग्िेज में, डनम्नडलडित में से ककस ऑपरे टर = '\0'; }
की सिोच्च प्राथडमकता है? A.*x++ = *y++ B. x = y
A.<= B.Unary + C. (*x)++ = (*y)++ D. None of the above
C.>= D.> Q 139. What will be the output of the following
Q 133. Which of the following operation cannot code segment, if the function is called as larger
be performing on pointers in C? / डनम्नडलडित में से (10, 20)? / डनम्नडलडित कोि सेगमेंट का आउटपुट क्या
कौन सा ऑपरे शन C में पॉइं टसि पर नहीं ककया जा सकता होगा, यकद फं क्शन को larger(10, 20) कहा जाता है?
है? int larger (int x, int y)
A.Substraction of a number from a pointer { int max = x; if (max < y)
B.Addition of two pointers { max = y; } else return A; print("Larger of %d and
C.Substraction of one pointer from another %d is %d", x, y, max); }
D.Addition of a number to a pointer

Page 13 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

A. Program will not compile as no statement is Q 144. Which of the following is not a proper
allowed after return statement. storage class in 'C'? / डनम्नडलडित में से कौन सी 'सी' में
B. Program will not compile as the function has प्रोपर स्टोरे ज क्लासेज नहीं है?
two return statements A. dec B. auto
C. Larger of 10 and 20 is 20 C. static D. extern
D. No output
Q 145. For the program given below, which of
Q 140. What is wrong with the following code? / the following statement is correct? / नीचे कदए गए
डनम्नडलडित कोि में क्या अनुपयुक्त है प्रोग्राम के डलए, कौन-सा कथन सत्य है
struct Person { char *name; struct Person Mother, void main ( )
Father; } Anita; { int i; for (scanf("%d", %i); print("%d",i)); }
A. name should be defined as an array A. The for loop would get executed only once.
B. The ; should appear after the } and Anita be B. The for loop would not get executed at all.
defined later. C. The for loop would get executed 5 times.
C. struct Person Mother, Father; must be defined D. The for loop would get executed infinite times
as struct Person *Mother, *Father;
Q 146. What is the output of the following code?
D. There is no error in the code
/ डनम्नडलडित कोि का पटरणाम क्या है?
Q 141. The size of a character variable in 'C' is: /
main( )
'C' में एक character िेटरएबल का आकार है: { static int num = 8; printf ("%d", num = num-2);
A. 8 bytes B. 4 bytes if(num1= 0)
C. 16 bytes D. None of the above main(); }
Q 142. What will be the output of the following A. Infinite output B. 8642
'C' program. / डनम्नडलडित 'C' प्रोग्राम का आउटपुट क्या C. 6420
होगा D. Invalid because main function can’t cailitself
main ( ) Q 147. Which of the following is a valid string
{ int a=5; float b= 5.0; if (a = = b) constant? / डनम्नडलडित में से कौन सा िैि मस्रंग कांस्टेंट
printf ("a and b are equal"); है?
else printf("a and b are different"); } A. “programming B. “programming”
A. a and b are different B. a and b are equal C. ‘programming D. $programming$
C. Error D. None of the above
Q 148. The value of the following ‘C’ expression
Q 143. Calculate the number of iterations in the
is: 2 + 18 / 4 - 1 / डनम्नडलडित 'C' एक्सप्रेशन का मान
following loop. / डनम्नडलडित लूप में iterations की
है: 2 + 18 / 4 - 1
संख्या का पता लगाएाँ A. 5 B. 5.5
main () C. 6 D. 4
{ int x = 5, y = 10, z = 9;
Q 149. How many times "India BIX" is get
for( ;x <= 5; ) { y ++; z ==; x = x+1/2;
if (z = = 0) z = y; } } printed? / "India BIX" ककतनी बार मप्रंट हुआ है?
A. Infinite B. Only one iteration int main()
C. 32762 D. None of the above { int x; for (x = - 1); x <= 10; x ++)
{ if (x < 5) continue; else

Page 14 of 15
KVS/NVS PGT C/C++ Language MCQ’s
INFIQUE CLASSES JAIPUR
S-2 Khandel Tower, Infront of Hotel Grand Safari, Near Gujar ki thadi, Gopalpura Bypass
MOB: 7014528940 / 8949174075

break; Q 157. Which of the following are not keywords


printf ("IndiaBIX"); } return 0; } in C? / डनम्नडलडित में से कौन C में कीििि नहीं हैं?
A. 11 times B. Infinite times A. main B. printf
C. 0 times D. 10 times C. IF D. All of the above
Q 150. Pick the operators that associate from the Q 158. Given the following code fragment: /
left: / बाई ओर से जुडे ऑपरे टरों को चुनें डनम्नडलडित कदया गया कोि िण्ि
A. , B. + void main (void)
C. % D. All of the above { char x = '\0'; char n = "N” ;
Q 151. Printing a character as an integer: / एक printf (“%u” “%s\n”, &n, &n); }
What will be the result of execution?
कै रे क्टर को पुणाांक (integer) के रूप में मप्रंट करना
A. 78N
A. always prints a positive integer
B. ddddd N (where d represents any digit)
B. results in the printing of a negative integer
C. 78 garbage
C. prints a value that is implementation
D. compilation error
dependent
D. none of the above Q 159. What would be value of j after the
Q 152. printf("^c", 100); following is executed? / डनम्न के डनष्पाकदत होने के
A. prints the ASCII equivalent of 100 बाद j का मान क्या होगा
B. prints 100 k = 17; j = 6; if(k < 10) j = 8; j = j + 1; j = j + 2 ;
C. prints garbage A. 9 B. 8
D. none of the above C. 7 D. 10

Q 153. Pick the operators that associate from the Q 160. What will be the output of the following?
right: / दाईं ओर से संबद् ऑपरे टरों को चुनें: / डनम्नडलडित का आउटपुट क्या होगा
A. + = B. ++ main ()
C. = D. All of the above { int a = ‘A’ * ;
printf("%d”, a);
Q 154. The statement:
A. A
printf("%f", (float) 9/5); मप्रंट करता है
B. 65
A. 1.0 B. 1.8
C. a
C. 2.0 D. None of the above
D. the program will not compile as an integer
Q 155. The following statement / डनम्नडलडित variable is assigned a character constant.
कथन printf ("%f", 9/5); मप्रंट करता है
Q 161. The value of variable x after executing the
A. 1.0 B. 1.8
following code will be: / डनम्नडलडित कोि को
C. 2.0 D. None of the above
डनष्पाकदत करने के बाद चर x का मान होगा
Q 156. Pick the operators whose meaning is
Val = -200; x = (val >= 0); val: - val;
context dependent: / उन ऑपरे टरों को चुनें डजनके A. 200 B. 0
अथि सन्दभि (context) पर आिाटरत है- C. -200 D. 1
A. # B. *
C. & D. All of the above

Page 15 of 15
KVS/NVS PGT C/C++ Language MCQ’s

You might also like