-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestions.xml
1266 lines (1186 loc) · 41.1 KB
/
questions.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<data>
<easy>
<question>
<title><![CDATA[
Who is father of C Language?
]]></title>
<option>Bjarne Stroustrup</option>
<option>Dennis Ritchie</option>
<option>James A. Gosling</option>
<option>Dr. E.F. Codd</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
C Language developed at _____?
]]></title>
<option>AT & T's Bell Laboratories of USA in 1972</option>
<option>AT & T's Bell Laboratories of USA in 1970</option>
<option>Sun Microsystems in 1973</option>
<option>Cambridge University in 1972</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
For 16-bit compiler allowable range for integer constants is ______ ?
]]></title>
<option>-3.4e38 to 3.4e38</option>
<option>-32767 to 32768</option>
<option>-32768 to 32767</option>
<option>-32668 to 32667</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
C programs are converted into machine language with the help of
]]></title>
<option>An Editor</option>
<option>A compiler</option>
<option>An operating system</option>
<option>None of the above</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
A C variable cannot start with
]]></title>
<option>An alphabet</option>
<option>A number</option>
<option>A special symbol other than underscore</option>
<option>both B.and C.</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
Which of the following is allowed in a C Arithmetic instruction
]]></title>
<option>[]</option>
<option>{}</option>
<option>()</option>
<option>None of the above</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
Which of the following shows the correct hierarchy of arithmetic operations in C
]]></title>
<option>/ + * -</option>
<option>* - / +</option>
<option>+ - / *</option>
<option>* / + -</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What is an array?
]]></title>
<option>An array is a collection of variables that are of the dissimilar data type.</option>
<option>An array is a collection of variables that are of the same data type.</option>
<option>An array is not a collection of variables that are of the same data type.</option>
<option>None of the above.</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
What is right way to Initialization array?
]]></title>
<option>int num[6] = { 2, 4, 12, 5, 45, 5 } ;</option>
<option>int n{} = { 2, 4, 12, 5, 45, 5 } ;</option>
<option>int n{6} = { 2, 4, 12 } ;</option>
<option>int n(6) = { 2, 4, 12, 5, 45, 5 } ;</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
An array elements are always stored in _________ memory locations.
]]></title>
<option>Sequential</option>
<option>Random</option>
<option>Sequential and Random</option>
<option>None of the above</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
What is the right way to access value of structure variable book{ price, page }?
]]></title>
<option>printf("%d%d", book.price, book.page);</option>
<option>printf("%d%d", price.book, page.book);</option>
<option>printf("%d%d", price::book, page::book);</option>
<option>printf("%d%d", price-&gt;book, page-&gt;book);</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
perror() function used to ?
]]></title>
<option>Work same as printf()</option>
<option>prints the error message specified by the compiler</option>
<option>prints the garbage value assigned by the compiler</option>
<option>None of the above</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
Bitwise operators can operate upon?
]]></title>
<option>double and chars</option>
<option>floats and doubles</option>
<option>ints and floats</option>
<option>ints and chars</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What is C Tokens?
]]></title>
<option>The smallest individual units of c program</option>
<option>The basic element recognized by the compiler</option>
<option>The largest individual units of program</option>
<option>A & B Both</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What is Keywords?
]]></title>
<option>Keywords have some predefine meanings and these meanings can be changed.</option>
<option>Keywords have some unknown meanings and these meanings cannot be changed.</option>
<option>Keywords have some predefine meanings and these meanings cannot be changed.</option>
<option>None of the above</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What is constant?
]]></title>
<option>Constants have fixed values that do not change during the execution of a program</option>
<option>Constants have fixed values that change during the execution of a program</option>
<option>Constants have unknown values that may be change during the execution of a program</option>
<option>None of the above</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
Which is the right way to declare constant in C?
]]></title>
<option>int constant var =10;</option>
<option>int const var = 10;</option>
<option>const int var = 10;</option>
<option>B & C Both</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
Which operators are known as Ternary Operator?
]]></title>
<option>::, ?</option>
<option>?, :</option>
<option>?, ;;</option>
<option>None of the above</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
In switch statement, each case instance value must be _______?
]]></title>
<option>Constant</option>
<option>Variable</option>
<option>Special Symbol</option>
<option>None of the above</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
What is the work of break keyword?
]]></title>
<option>Halt execution of program</option>
<option>Restart execution of program</option>
<option>Exit from loop or switch statement</option>
<option>None of the above</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What is function?
]]></title>
<option>Function is a block of statements that perform some specific task.</option>
<option>Function is the fundamental modular unit. A function is usually designed to perform a specific task.</option>
<option>Function is a block of code that performs a specific task. It has a name and it is reusable</option>
<option>All the above</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
Which one of the following sentences is true ?
]]></title>
<option>The body of a while loop is executed at least once.</option>
<option>The body of a do ... while loop is executed at least once.</option>
<option>The body of a do ... while loop is executed zero or more times.</option>
<option>A for loop can never be used in place of a while loop.</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
A binary tree with 27 nodes has _______ null branches.
]]></title>
<option>54</option>
<option>27</option>
<option>26</option>
<option>None of the above</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
Which one of the following is not a linear data structure?
]]></title>
<option>Array</option>
<option>Binary Tree</option>
<option>Queue</option>
<option>Stack</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
Recursive functions are executed in a?
]]></title>
<option>First In First Out Order</option>
<option>Load Balancing</option>
<option>Parallel Fashion</option>
<option>Last In First Out Order</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
Queue is a _____________ list.
]]></title>
<option>LIFO</option>
<option>LILO</option>
<option>FILO</option>
<option>FIFO</option>
<answer>4</answer>
</question>
</easy>
<medium>
<question>
<title><![CDATA[
The statement printf("%d", 10 ? 0 ? 5 : 1 : 12); will print?
]]></title>
<option>10</option>
<option>0</option>
<option>12</option>
<option>1</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
To represent hierarchical relationship between elements, which data structure is suitable?
]]></title>
<option>Priority</option>
<option>Tree</option>
<option>Dqueue</option>
<option>All of the above</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
Which of the following data structure is linear type?
]]></title>
<option>Strings</option>
<option>Queue</option>
<option>Lists</option>
<option>All of the above</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
The statement printf("%c", 100); will print?
]]></title>
<option>prints 100</option>
<option>print garbage</option>
<option>prints ASCII equivalent of 100</option>
<option>None of the above</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
The _______ memory allocation function modifies the previous allocated space.
]]></title>
<option>calloc</option>
<option>free</option>
<option>malloc</option>
<option>realloc</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
Number of binary trees formed with 5 nodes are
]]></title>
<option>30</option>
<option>36</option>
<option>108</option>
<option>42</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
The "C" language is
]]></title>
<option>Context free language</option>
<option>Context sensitive language</option>
<option>Regular language</option>
<option>None of the above</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
The worst case time complexity of AVL tree is better in comparison to binary search tree for
]]></title>
<option>Search and Insert Operations</option>
<option>Search and Delete Operations</option>
<option>Insert and Delete Operations</option>
<option>Search, Insert and Delete Operations</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
In which tree, for every node the height of its left subtree and right subtree differ almost by one?
]]></title>
<option>Binary search tree</option>
<option>AVL tree</option>
<option>Threaded Binary Tree</option>
<option>Complete Binary Tree</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
C is ______ Language?
]]></title>
<option>Low Level</option>
<option>High Level</option>
<option>Assembly Level</option>
<option>Machine Level</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
The Default Parameter Passing Mechanism is called as
]]></title>
<option>Call by Value</option>
<option>Call by Reference</option>
<option>Call by Address</option>
<option>Call by Name</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
What is Dequeue?
]]></title>
<option>Elements can be added from front</option>
<option>Elements can be added to or removed from either the front or rear</option>
<option>Elements can be added from rear</option>
<option>None of the above</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
In which linked list last node address is null?
]]></title>
<option>Doubly linked list</option>
<option>Circular list</option>
<option>Singly linked list</option>
<option>None of the above</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
Which is the correct syntax to declare constant pointer?
]]></title>
<option>int *const constPtr;</option>
<option>*int constant constPtr;</option>
<option>const int *constPtr;</option>
<option>A and C both</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following arithmetic expression ?
<div class="code">
<span class="line-number">1 </span>5+3*2%10-8*6
</div>
]]></title>
<option>-37</option>
<option>-42</option>
<option>-32</option>
<option>-28</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statement ?
<div class="code">
<span class="line-number">1 </span>int a=10; printf("%d &i",a,10);
</div>
]]></title>
<option>error</option>
<option>10</option>
<option>10 10</option>
<option>none of these</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statement ?
<div class="code">
<span class="line-number">1 </span>printf("%X%x%ci%x",11,10,'s',12);
</div>
]]></title>
<option>error</option>
<option>basc</option>
<option>Bas94c</option>
<option>none of these</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statements ?
<div class="code">
<span class="line-number">1 </span>int a = 4, b = 7,c; c = a = = b; printf("%i",c);
</div>
]]></title>
<option>0</option>
<option>error</option>
<option>1</option>
<option>garbage value</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statements ?
<div class="code">
<span class="line-number">1 </span>int a = 5, b = 2, c = 10, i = a&gt;b
<span class="line-number">2 </span>
<span class="line-number">3 </span>void main()
<span class="line-number">4 </span>
<span class="line-number">5 </span>{ printf("hello"); main(); }
</div>
]]></title>
<option>1</option>
<option>2</option>
<option>infinite number of times</option>
<option>none of these</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What will be output if you will compile and execute the following c code?
<div class="code">
<span class="line-number">1 </span>struct marks{
<span class="line-number">2 </span> int p:3;
<span class="line-number">3 </span> int c:3;
<span class="line-number">4 </span> int m:2;
<span class="line-number">5 </span>};
<span class="line-number">6 </span>
<span class="line-number">7 </span>void main(){
<span class="line-number">8 </span> struct marks s={2,-6,5};
<span class="line-number">9 </span> printf("%d %d %d",s.p,s.c,s.m);
<span class="line-number">10</span>}
</div>
]]></title>
<option>2 -6 5</option>
<option>2 -6 1</option>
<option>2 2 1</option>
<option>Compiler error</option>
<option>None of these</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statements ?
<div class="code">
<span class="line-number">1 </span>int x[4] = {1,2,3}; printf("%d %d %D",x[3],x[2],x[1]);
</div>
]]></title>
<option>03%D</option>
<option>000</option>
<option>032</option>
<option>321</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statement ?
<div class="code">
<span class="line-number">1 </span>printf( 3 + "goodbye");
</div>
]]></title>
<option>goodbye</option>
<option>odbye</option>
<option>bye</option>
<option>dbye</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statements ?
<div class="code">
<span class="line-number">1 </span>long int a = scanf("%ld%ld",&a,&a); printf("%ld",a);
</div>
]]></title>
<option>error</option>
<option>garbage value</option>
<option>0</option>
<option>2</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following program ?
<div class="code">
<span class="line-number">1 </span>#include
<span class="line-number">2 </span>
<span class="line-number">3 </span>void main(){
<span class="line-number">4 </span> int a = 2;
<span class="line-number">5 </span>
<span class="line-number">6 </span> switchA.
<span class="line-number">7 </span> {
<span class="line-number">8 </span> case 1: printf("goodbye"); break;
<span class="line-number">9 </span> case 2: continue;
<span class="line-number">10</span> case 3: printf("bye");
<span class="line-number">11</span> }
<span class="line-number">12</span>}
</div>
]]></title>
<option>error</option>
<option>goodbye</option>
<option>bye</option>
<option>byegoodbye</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statements ?
<div class="code">
<span class="line-number">1 </span>int i = 1,j; j=i--- -2; printf("%d",j);
</div>
]]></title>
<option>error</option>
<option>2</option>
<option>3</option>
<option>-3</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What will be the output of following program ?
<div class="code">
<span class="line-number">1 </span>#include
<span class="line-number">2 </span>
<span class="line-number">3 </span>main()
<span class="line-number">4 </span>
<span class="line-number">5 </span>{
<span class="line-number">6 </span>
<span class="line-number">7 </span> int x,y = 10;
<span class="line-number">8 </span>
<span class="line-number">9 </span> x = y * NULL;
<span class="line-number">10</span>
<span class="line-number">11</span> printf("%d",x);
<span class="line-number">12</span>
<span class="line-number">13</span>}
</div>
]]></title>
<option>error</option>
<option>0</option>
<option>10</option>
<option>garbage value</option>
<answer>2</answer>
</question>
</medium>
<hard>
<question>
<title><![CDATA[
What will be the output of following statements ?
<div class="code">
<span class="line-number">1 </span>char x[ ] = "hello hi"; printf("%d%d",sizeof(*x),sizeof(x));
</div>
]]></title>
<option>88</option>
<option>18</option>
<option>29</option>
<option>19</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statements ?
<div class="code">
<span class="line-number">1 </span>int a=5,b=6,c=9,d; d=(ac?1:2):(c&gt;b?6:8)); printf("%d",d);
</div>
]]></title>
<option>1</option>
<option>2</option>
<option>6</option>
<option>Error</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following statements ?
<div class="code">
<span class="line-number">1 </span>int i = 3;
<span class="line-number">2 </span>
<span class="line-number">3 </span>printf("%d%d",i,i++);
</div>
]]></title>
<option>34</option>
<option>43</option>
<option>44</option>
<option>33</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
What will be the output of the following program ?
<div class="code">
<span class="line-number">1 </span>#include
<span class="line-number">2 </span>
<span class="line-number">3 </span>void main()
<span class="line-number">4 </span>
<span class="line-number">5 </span>{
<span class="line-number">6 </span>
<span class="line-number">7 </span> int a = 36, b = 9;
<span class="line-number">8 </span>
<span class="line-number">9 </span> printf("%d",a&gt;&gt;a/b-2);
<span class="line-number">10</span>
<span class="line-number">11</span>}
</div>
]]></title>
<option>9</option>
<option>7</option>
<option>5</option>
<option>none of these</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
<div class="code">
<span class="line-number">1 </span>int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
</div>
What value does testarray[2][1][0] in the sample code above contain?
]]></title>
<option>11</option>
<option>7</option>
<option>5</option>
<option>9</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
<div class="code">
<span class="line-number">1 </span>void main()
<span class="line-number">2 </span>
<span class="line-number">3 </span>{
<span class="line-number">4 </span>
<span class="line-number">5 </span> int a=10,b=20;
<span class="line-number">6 </span>
<span class="line-number">7 </span> char x=1,y=0;
<span class="line-number">8 </span>
<span class="line-number">9 </span> if(a,b,x,y)
<span class="line-number">10</span> {
<span class="line-number">11</span> printf("EXAM");
<span class="line-number">12</span> }
<span class="line-number">13</span>
<span class="line-number">14</span>}
</div>
What is the output?
]]></title>
<option>XAM is printed</option>
<option>exam is printed</option>
<option>Compiler Error</option>
<option>Nothing is printed</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What is the output of the following code?
<div class="code">
<span class="line-number">1 </span>#include
<span class="line-number">2 </span>
<span class="line-number">3 </span>void main()
<span class="line-number">4 </span>{
<span class="line-number">5 </span> int s=0;
<span class="line-number">6 </span> while(s++&lt;10)&gt;
<span class="line-number">7 </span>
<span class="line-number">8 </span># define a 10
<span class="line-number">9 </span>
<span class="line-number">10</span> main()
<span class="line-number">11</span> {
<span class="line-number">12</span> printf("%d..",a);
<span class="line-number">13</span> foo();
<span class="line-number">14</span> printf("%d",a);
<span class="line-number">15</span> }
<span class="line-number">16</span>
<span class="line-number">17</span> void foo()
<span class="line-number">18</span> {
<span class="line-number">19</span>#undef a
<span class="line-number">20</span>#define a 50
<span class="line-number">21</span> }
</div>
]]></title>
<option>10..10</option>
<option>10..50</option>
<option>Error</option>
<option>0</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
<div class="code">
<span class="line-number">1 </span>main()
<span class="line-number">2 </span>{
<span class="line-number">3 </span>
<span class="line-number">4 </span> struct
<span class="line-number">5 </span> {
<span class="line-number">6 </span> int i;
<span class="line-number">7 </span> }xyz;
<span class="line-number">8 </span>
<span class="line-number">9 </span> (*xyz)-&gt;i=10;
<span class="line-number">10</span>
<span class="line-number">11</span> printf("%d",xyz.i);
<span class="line-number">12</span>
<span class="line-number">13</span>}
</div>
What is the output of this program?
]]></title>
<option>program will not compile</option>
<option>10</option>
<option>god only knows</option>
<option>address of I</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
]]></title>
<option> The element will be set to 0.</option>
<option> The compiler would report an error.</option>
<option> The program may crash if some important data gets overwritten.</option>
<option> The array size would appropriately grow.</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What would be the output of the following program?
<div class="code">
<span class="line-number">1 </span>#include
<span class="line-number">2 </span>
<span class="line-number">3 </span>main()
<span class="line-number">4 </span>{
<span class="line-number">5 </span> char str[]="S\065AB";
<span class="line-number">6 </span> printf("\n%d", sizeof(str));
<span class="line-number">7 </span>}
</div>
]]></title>
<option>7</option>
<option>6</option>
<option>5</option>
<option>error</option>
<answer>2</answer>
</question>
<question>
<title><![CDATA[
What will be the value of `a` after the following code is executed
<div class="code">
<span class="line-number">1 </span>#define square(x) x*x
<span class="line-number">2 </span>
<span class="line-number">3 </span>a = square(2+3);
</div>
]]></title>
<option>25</option>
<option>13</option>
<option>11</option>
<option>10</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
<div class="code">
<span class="line-number">1 </span>long factorial (long x)
<span class="line-number">2 </span>{
<span class="line-number">3 </span> ????
<span class="line-number">4 </span>
<span class="line-number">5 </span> return x * factorial(x - 1);
<span class="line-number">6 </span>}
</div>
With what do you replace the ???? to make the function shown above return the correct answer?
]]></title>
<option>if (x == 0) return 0;</option>
<option>return 1;</option>
<option>if (x &gt;= 2) return 2;</option>
<option>if (x &lt;= 1) return 1;</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
<div class="code">
<span class="line-number">1 </span>int y[4] = {6, 7, 8, 9};
<span class="line-number">2 </span>
<span class="line-number">3 </span>int *ptr = y + 2; printf("%d\n", ptr[ 1 ] );
</div>
What is printed when the sample code above is executed?
]]></title>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
<div class="code">
<span class="line-number">1 </span>int i = 4;
<span class="line-number">2 </span>
<span class="line-number">3 </span>switch (i)
<span class="line-number">4 </span>{
<span class="line-number">5 </span> default: ;
<span class="line-number">6 </span> case 3:
<span class="line-number">7 </span> i += 5;
<span class="line-number">8 </span> if (i == 8)
<span class="line-number">9 </span> {
<span class="line-number">10</span> i++;
<span class="line-number">11</span> if (i == 9) break;
<span class="line-number">12</span> i *= 2;
<span class="line-number">13</span> }
<span class="line-number">14</span> i -= 4;
<span class="line-number">15</span> break;
<span class="line-number">16</span> case 8:
<span class="line-number">17</span> i += 5;
<span class="line-number">18</span> break;
<span class="line-number">19</span>
<span class="line-number">20</span>}
<span class="line-number">21</span>
<span class="line-number">22</span>printf("i = %d\n", i);
</div>
What will the output of the sample code above be?
]]></title>
<option>i = 5</option>
<option>i = 8</option>
<option>i = 9</option>
<option>i = 10</option>
<answer>1</answer>
</question>
<question>
<title><![CDATA[
What will be output if you will compile and execute the following c code?
<div class="code">
<span class="line-number">1 </span>void main()
<span class="line-number">2 </span>{
<span class="line-number">3 </span> if(printf("cquestionbank"))
<span class="line-number">4 </span> printf("I know c");
<span class="line-number">5 </span>
<span class="line-number">6 </span> else
<span class="line-number">7 </span> printf("I know c++");
<span class="line-number">8 </span>}
</div>
]]></title>
<option>I know c</option>
<option>I know c++</option>
<option>cquestionbankI know c</option>
<option>cquestionbankI know c++</option>
<option>Compiler error</option>
<answer>3</answer>
</question>
<question>
<title><![CDATA[
What will be output if you will compile and execute the following c code?
<div class="code">
<span class="line-number">1 </span>#define call(x) #x
<span class="line-number">2 </span>
<span class="line-number">3 </span>void main(){
<span class="line-number">4 </span>
<span class="line-number">5 </span> printf("%s",call(c/c++));
<span class="line-number">6 </span>
<span class="line-number">7 </span>}
</div>
]]></title>
<option>c</option>
<option>c++</option>
<option>#c/c++</option>
<option>c/c++</option>
<option>Compiler error</option>
<answer>4</answer>
</question>
<question>
<title><![CDATA[
What will be output if you will compile and execute the following c code?
<div class="code">
<span class="line-number">1 </span>#define message "union is\
<span class="line-number">2 </span>
<span class="line-number">3 </span>power of c"
<span class="line-number">4 </span>
<span class="line-number">5 </span>void main()
<span class="line-number">6 </span>{
<span class="line-number">7 </span>
<span class="line-number">8 </span> clrscr();
<span class="line-number">9 </span> printf("%s",message);
<span class="line-number">10</span> getch();
<span class="line-number">11</span>
<span class="line-number">12</span>}
</div>
]]></title>