Quiznetik

Programming for Problem Solving | Set 1

1. Which Of The Following Are Components Of Central Processing Unit (CPU)?

Correct : B. Arithmetic Logic Unit, Control Unit

2. In Which Of The Following Form, Data Is Stored In Computer?

Correct : B. Binary

3. Which Level Language Is Assembly Language?

Correct : C. Low-Level Programming Language

4. 1 Mega Byte Is Equal To

Correct : B. 1024 Kilo Bytes

5. One Byte Is Equal To How Many Bits ?

Correct : B. 8 Bits

6. One Nibble Is Equal To How Many Bits ?

Correct : A. 4 Bits

7. An Assembler Is Used To Translate A Program Written In ?

Correct : C. Assembly Language

8. We Can Insert Pre Written Code In A C Program By Using

Correct : C. #Include

9. Ritchie And Brian Kernighan Jointly Carried Out The Development Of C And That Version Is ________ .

Correct : B. K&R C

10. Who Was Creator Of B Language, Which Inspired Dennis Ritchie To Create Strong Procedural Language Called C?

Correct : D. Ken Thompson

11. Which Committee Standardize C Programming Language?

Correct : B. ANSI

12. Dennis Was Author Of Famous Programming Book _________ .

Correct : C. The C Programming Language

13. Many Features Of C Were Derived From An Earlier Language Called _____.

Correct : D. B

14. C Programming Was Created At ______ By Dennis Ritchie.

Correct : A. AT&T Bell Laboratory

15. Which Type Of Software Is An Operating System?

Correct : B. System Software

16. Microsoft Office Is Type Of?

Correct : C. Application Software

17. How Many Main() Function We Can Have In Our Project?

Correct : A. 1

18. Is It Possible To Run Program Without Main() Function?

Correct : A. Yes

19. What Is Sizeof() In C?

Correct : A. Operator

20. Bitwise Operators Can Operate Upon?

Correct : D. Int And Chars

21. What Is C Tokens?

Correct : D. A & B Both

22. What Is Keywords?

Correct : C. Keywords Have Some Predefine Meanings And These Meanings Cannot Be Changed.

23. What Is Constant? A Constants Have Fixed Values That Do Not Change During The Execution Of

Correct : A. Program

24. Which Is The Right Way To Declare Constant In C?

Correct : D. B & C Both

25. Which Operators Are Known As Ternary Operator?

Correct : B. ?, :

26. Total Number Of Keywords In C Are

Correct : D. 32

27. The Compiler In C Ignores All Text Till The End Of Line Using

Correct : A. //

28. Printf() Belongs To Which Library Of C

Correct : B. Stdio.H

29. What Is Correct Order Of Precedence In C

Correct : D. Modulus, Multiplication, Substration

30. In Switch Statement, Each Case Instance Value Must Be _______?

Correct : A. Constant

31. What Is The Work Of Break Keyword?

Correct : C. Exit From Loop Or Switch Statement

32. Which One Of The Following Sentences Is True ?

Correct : B. The Body Of A Do ... While Loop Is Executed At Least Once.

33. A C Variable Cannot Start With

Correct : D. Both (B) And (C)

34. Which Of The Following Shows The Correct Hierarchy Of Arithmetic Operations In C

Correct : D. * / + -

35. Int Main() { Extern Int I; I = 20; Printf("%D", Sizeof(I)); Return 0; }

Correct : C. Undefined Reference To I

36. Is The Following Statement A Declaration Or Definition Extern Int I;

Correct : A. Declaration

37. Int Main() { Int X = 10; { Int X = 0; Printf("%D",X); } Return 0; }

Correct : C. '0'

38. //This Program Is Compiled On 32 Bit DEV-C++ Int Main() { Char *Ptr1, *Ptr2; Printf("%D %D", Sizeof(Ptr1), Sizeof(Ptr2)); Return 0; }

Correct : C. 4 4

39. What Should Be The Output: Int Main() { Int A = 10/3; Printf("%D",A); Return 0; }

Correct : C. 3

40. Which Of The Following Is Executed By Preprocess?

Correct : A. #Include<Stdio.H>

41. Int Main() { Int A = 10.5; Printf("%D",A); Return 0; }

Correct : C. 10

42. Int Main() { Int _ = 10; Int __ = 20; Int ___ = _ + __; Printf("__%D",___); Return 0; }

Correct : D. __30

43. Int Main() { Int A = 5; Int B = 10; Int C = A+B; Printf("%I",C);

Correct : B. 15

44. int main() { int x; x=10,20,30; printf("%d",x); return 0; }

Correct : A. 10

45. How many times C.com is printed? int main() { int a = 0; while(a++ < 5-++a) printf("C.com"); return 0; }

Correct : D. 1 times

46. How many times C.com is printed? int main() { int a = 0; while(a++ < 5) printf("C.com"); return 0; }

Correct : A. 5 times

47. How many times C.com is printed? int main() { int a = 0; while(a++) printf("C.com"); return 0; }

Correct : B. 0 time

48. How many times C.com is printed? int main() { int a = 0; while(++a) { printf("C.com"); } return 0; }

Correct : B. Infinite Times(Untill Stack is overflow)

49. What is output of below program? int main() { int i,j,count; count=0; for(i=0; i<5; i++); { for(j=0;j<5;j++); { count++; } } printf("%d",count); return 0; }

Correct : C. 1

50. What is output of below program? int main() { int i,j,k,count; count=0; for(i=0;i<5;i++) { for(j=0;j<5;j++) { count++; } } printf("%d",count); return 0; }

Correct : C. 25

51. What is output of below program? int main() { int i,j; for(i = 0,j=0;i<5;i++) { printf("%d%d--",i,j); } return 0; }

Correct : B. 00--10--20--30--40--

52. What is output of below program? int main() { int i; for(i=0; i<5; ++i++) { printf("Hello"); } return 0; }

Correct : B. Compilation Error

53. What is output of below program? int main() { for(; ;); for(; ;); printf("Hello"); return 0; }

Correct : C. Nothing is printed

54. What is the output of below program? int main() { for(; ;) for(; ;) printf("Hello.."); return 0; }

Correct : D. Hello is printed infinite times

55. How many loops are there in C

Correct : C. 3

56. What is the following is invalid header file in C?

Correct : B. mathio.h

57. What is storage class for variable A in below code? int main() { int A; A = 10; printf("%d", A); return 0; }

Correct : B. auto

58. #include "stdio.h" int main() { int a@ = 10; printf("%d", a@); return 0; }

Correct : D. [Error] stray '@' in program

59. #include "stdio.h" int main() { int a = 10; printf("%d", a); int a = 20; printf("%d",a); return 0; }

Correct : B. Error: Redeclartion of a

60. #include "stdio.h" int a = 20; int main() { int a = 10; printf("%d", ::a); return 0; }

Correct : B. 20

61. #include "stdio.h" int main() { int a = 10, b = 20; if(a=b) { printf("Easy"); } else { printf("Hard"); } return 0; }

Correct : A. Easy

62. Which gcc flag is used to enable all Compiler warnings?

Correct : C. gcc -Wall

63. Which gcc flag is used to generate maximum debug information?

Correct : D. gcc –g3

64. Which macro is used to insert assembly code in C program (VC++ compiler)?

Correct : C. __asm

65. Which macro is used to insert assembly code in C program (GCC compiler)?

Correct : A. __asm__

66. Will compiler produce any compilation error if same header file is included two times?

Correct : B. NO

67. What should be the output of below program? #define # @ @include "stdio.h" int main() { printf("C.com"); return 0; }

Correct : C. Compilation Error

68. Which one of the following is invalid macro in C programming?

Correct : D. #elseif

69. What is the extension of output file produced by Preprocessor?

Correct : C. .i

70. Set of consecutive memory locations is called as ________.

Correct : B. Array

71. Array can be considered as set of elements stored in consecutive memory locations but having __________.

Correct : A. Same Data Type

72. In Array, There is one to one correspondence between set of ________ and set of values.

Correct : A. Indices

73. Smallest element of an array is called as _______.

Correct : D. Lower Bound

74. If we have declared an array described below – int arr[6]; then which of the following array element is considered as last array element ?

Correct : D. arr[5]

75. Array which is having ____ dimensions is called as 2-D array.

Correct : B. 2

76. What is maximum dimension that array can have in c programming?

Correct : C. Theoretically No Limit but practically limit depends on memory

77. Array with last element 'n' will always have array size equal to _______.

Correct : A. n+1

78. Array is an example of _______ type memory allocation.

Correct : A. Compile Time

79. Array is ______ data type in C Programming language.

Correct : D. Derived Data Type

80. A Pointer to a block of memory is considered same as an array.

Correct : B. YES

81. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

Correct : D. The program may crash if some important data gets overwritten.

82. If you pass an array as an argument to a function, what actually gets passed?

Correct : A. Base address of the array

83. Pointer is special kind of variable which is used to store __________ of the variable.

Correct : A. Address

84. Pointer variable is declared using preceding _________ sign.

Correct : B. *

85. Address stored in the pointer variable is of type __________.

Correct : A. Integer

86. Consider the 32 bit compiler. We need to store address of integer variable to integer pointer. What will be the size of integer pointer?

Correct : C. 2 Bytes

87. In order to fetch the address of the variable we write preceding _________ sign before variable name.

Correct : D. Ampersand

88. What is right way to Initialization array?

Correct : A. int num[6] = { 2, 4, 12, 5, 45, 5 } ;

89. What is the right way to access value of structure variable book{ price, page }?

Correct : A. printf("%d%d", book.price, book.page);

90. What is true about fputs function

Correct : D. all of above

91. Wild pointer in C

Correct : B. if pointer has not been initialized

92. Any type of modification on the parameter inside the function will reflect in actual variable value can be related to..

Correct : B. call by reference

93. Size of void pointer is

Correct : B. 2 byte

94. To print a single character in ouptut,which function is used?

Correct : C. putchar()

95. #define t 10 void main() { printf("%d",t); }

Correct : A. 10

96. Explicit data type conversion is called

Correct : A. Type casting

97. which of these is not a valid character constant

Correct : A. “A”

98. If 'a' is the integer which is not statically initialized then what is the value of 'a'?

Correct : B. garbage

99. C is a ____________________ language

Correct : B. Platform dependent programming

100. In a function call, _____________ is passed as arguments.

Correct : D. All the above