50
C-program 1.Reusability is not the feature of----------- a. C++ b. java c. VB.net d. C Ans: d 2. A C Variable cannot start with a. A Number b. An Alphabet c. A special Symbol d. Option 1 AND Option 3 Ans:d 3.What are Character Constants? a. A character constant is a single character enclosed in single quotation marks. b. A character constant is a single character. c. A character constant is a character with numeric value. d. None of the above. Ans:a 4. i)strlen()used to Finds length of string ii)strlwr()used to Converts string to lowercase Find correct statement from above ? a.i b.ii c.i & ii d.none Ans:c 5.____ is a name given to memory location where we stores the constants a. Program b.Variable c.Function d. Loop Ans: b 6.i)If the CPU registers are not available,you can use static storage variables ii)C Accepts Two Diamentional Array Find correct statement from above ? 1

Documentc

Embed Size (px)

Citation preview

Page 1: Documentc

C-program

1.Reusability is not the feature of-----------a. C++ b. java c. VB.net d. CAns: d

2. A C Variable cannot start with a. A Number b. An Alphabet c. A special Symbol d. Option 1 AND Option 3 Ans:d

3.What are Character Constants?a. A character constant is a single character enclosed in single quotation marks.b. A character constant is a single character.c. A character constant is a character with numeric value.d. None of the above.Ans:a

4. i)strlen()used to Finds length of string ii)strlwr()used to Converts string to lowercase Find correct statement from above ?a.i b.ii c.i & ii d.noneAns:c

5.____ is a name given to memory location where we stores the constantsa. Program b.Variable c.Function d. LoopAns: b

6.i)If the CPU registers are not available,you can use static storage variables ii)C Accepts Two Diamentional Array Find correct statement from above ? a.i b.ii c.i & ii d.noneAns:b

7.______ is used to denote unsigned integer a. %d b. %f c. %u d. %c

Ans:c

8.The operator / can be applied to a. integer values b. float values c. double values d. All of these Ans: d

9.C can be on a.Ms-Dos b.Unix c.Linux d. All of these Ans: d

1

Page 2: Documentc

C-program

10.This function accepts only String values. a.getchar b.getc c.gets d. scanf("%c",&a) Ans: c

11.This function prints only string values a.putchar b.putc c.printf d.putsAns:d

12.What is the purpose of fgetc() functiona. The fgetc() function gets a character from a streamb. The fgetc() function gets a number from a streamc. The fgetc() function gets a number and a character from a streamd. None of the above.

Ans:c

13. if a=10 then,if(a%3) produce the value a.2 b.3 c.1 d.0Ans: c

14. for(i=0;i<10;i—) This loop stop after a.10 times b.9times c. Immediately d.neverAns: d

15.What is the extension of object code developed by the compiler?a. .cmp b. .object c. .obj d.none of the above

Ans: c

16. Name the functions which are available in character I/O formata. getch(), getche(), getchar() b. getc(), clrscr()c. gets(), strcpy() d.none of the aboveAns:a

17. What is the default way of passing the arguments in a functiona.call by value b.call by reference c. Call by both value and reference d. Call by variableAns:a

2

Page 3: Documentc

C-program

18.isupper() is used for a. Changing the character to uppercase b. Checking the case is upper or notc. For both d. None of the aboveAns:b

19.What do header files consist of?a. Examples of functions. b. Prototype examples.c. Function declarations. d. Function definitions.Ans:d

20. i)We can create our own header file and put our own functions in it. ii)We can store 1000 values by using only one variable in c language Which answer is suitable for abow sentences ? a.i b.ii c. i & ii d.NoneAns:c

21. Value in an Array can accessed using a.Value b.Address c.index d.None of the LeftAns:c

22.Which is not a valid version of C out of the following?a.ANSI b.Micro c.Unixc d.TurboAns:b

23. i)if(a=10)is Wrong? ii)Run time declaration is allowed in C Find correct statement from above ?a.i b.ii c. i & ii d.NoneAns:a

24.What is the use of sprintf()a. Writes the ouput to string. b. Writes the output to an array of charactersc. Writes the output the file d. Writes the output to screenAns:b

3

Page 4: Documentc

C-program

25.strcat function is used fora. To concatenate the strings b. To compare the stringc. To duplicate the string d. To copy one string to anotherAns:a

26. Which of the following is not the type of operators?a. Sizeof Operators b. Cast Operators c. Ternary Operators d. Boolean OperatorsAns:d

27. this function return single character from standard Inputdevice a.putchar b. getchar c. putc d. getcAns:b

28. The type cast operator is a. (type) b. cast() c. // d.Ans:a

29. What is ‘C’a. ‘C’ is a programming language b. ‘C’ is a English like languagec. ‘C’ is a middle level language d. All the aboveAns:d

30. Full form of ANSI is a. American National Standard Institute b. All Nation’s Standard Infrastructurec. American National Standard Interface d. All Nation’s Social InstituteAns: a

31. To compile the file we have to use the short cut key as a. Alt+F9 b. Ctrl+F9 c. F5 d. F9Ans:a

32. A character variable can at A time store a.1 character b.8 characters c. 254 characters d.None of the leftAns:a

33. This function return single character from input device

4

Page 5: Documentc

C-program

a.putchar b.getchar c.putc d.getcAns:d

34. Character constants should be enclosed between ____________a. Single quotes b. Double quotes c. Both a and b d. None of theseAns:a

35. i)if Scanf("%c",a), the variable 'a ' accepts characters ii)char name='AJAY' Find correct statement from above ?a.i b.ii c. i & ii d.NoneAns:d

36. ____ are used to stores the values a) Variable b) Function c) Arrays d) Loopsa. i only b. i and iii c. i, ii and iii d. all of the aboveAns:b

37. i)strcmp()used to cmpares two strings ii)strrev()used to reverse string Find correct statement from above ? a.i b.ii c. i & ii d.NoneAns:c

38. If the size of the array is less than the number of initializers then, a.Extra values are being ignored b. Generates an error messagec. Size of Array is increased d. Size is neglected when values are givenAns:b

39. What output will the following statement gives Printf(“The answer is=%d”,a%b); Where a=25 and b=10 a.2.5 b.2 c.5 d.None of theseAns:c

40. Compliling Starts from a. main Function b. void function() c. For loop d. getch();Ans:a

41. What will be the output of the expression 11 ^ 5? a.5 b.6 c.11 d.None of These

5

Page 6: Documentc

C-program

Ans:d

42. ferror() reports any error that might have occurred during-------operation on file.a.read b.write c. read/write d. There is no such functionAns:d

43. if a=13.24 then,if(a%3) produce the value a.2 b.3 c.0 d.1Ans:d

44. C is modified version of which languagesa.C++ b.VC++ c. B and BPCL d. C++ and VC++Ans:c 45. What will be the value of I in following statement? The statement is I=strcmp(“Jerry”,”Jerry”); a. Strings are equal b.1 c.TRUE d.0Ans:d

46. This keyword allows us jump statements outside the loop a.break b.exit c. continue d.None of the aboveAns:a

47. Which operator is used with goto statement a. : b. ; c. ! d. &

Ans:a

48.This keyword allows us passing statements inside the loop a.break b.exit c. continue d.None of the aboveAns:c

49. On some occasions it may be desirable to cause a defined name to become undefined. This can be accomplished by means of -------------directive.a. #undefine b. #undef c. #undefined d. #undefinAns:b

50. Which of the following is not the type of instruction?a. Arithmetic instruction b. Type declaration instruction

6

Page 7: Documentc

C-program

c. Control Instruction d. Input InstructionAns:d

51. In Pointer,'&' is represent a. Address Operator b. value of address c. Address of Address d. None of The Left Ans:a

52. Maximum number of elements in the array declaration int a[5][8] is a.28 b.32 c.35 d.40Ans:d

53. Which of the following is the boolean operator for logical-and?a. & b. && c. | d. |&Ans:b

54. i)Language is case sensitive ii)Write C algorithm we have to write C code in that algorithm Find correct statement from above ? a.i b.ii c. i & ii d.NoneAns:a

55. Which of the following is not the processor?a. Debugger b. Editor c. Preprocessor d. CompilerAns:a

56. It is a Prechecking loop a. for loop b. while loop c. do-while loop d. None of The Above Ans:b

57. The exit statement is used to exit from a. if statement b. for loop c. a program d. function Ans:c

58. i)The Register storage class variables cannot hold float value ii)Most of the

7

Page 8: Documentc

C-program

times we need to use atomatic storage class variables Find correct statement from above ?a.i b.ii c. i & ii d.NoneAns:d

59. i)strdup()used to duplicates a string ii)strupr()used to converts a string to uppercase Find correct statement from above ?a.i b.ii c. i & ii d.NoneAns:c

60. Which of the statement is true i) Program requires at least one main function ii) Program does not requires any main function iii) Program requires more than one main function iv) Program requires one & only main functiona. All statements b. i is true c. i and iii are true d. iv is trueAns:d

61. After Compiling the C Source File TC creates a new file asa. .exe b. .bak c. .obj d. .c

Ans:c

62. Compliling Starts from a. Main Function b. #include c. For loop d. Getch();Ans:a

63. C is developed in the year ofa.1970 b.1972 c.1989 d.1976Ans.b

64. Full form of ANSI is a. American National Standard Institute b. All Nation’s Standard Infrastructurec. American National Standard Interface d. All Nation’s Social InstituteAns:a

65. i)if(a=10)is Wrong? ii)Run time declaration is allowed in C Find correct statement from above ?a.i b.ii c. i & ii d.NoneAns:a66. This is not valid increment statement

8

Page 9: Documentc

C-program

a. a++; b. ++a; c. a+=2; d.noneAns: d

67. for(i=0;i<10;i—) This loop stop after a.10times b.9times c. Immediately d.NeverAns:d

68. ____ is a name given to memory location where we stores the constantsa.Program b.Variable c.Function d.LoopAns:b

69. i)if(a==10) is Wrong? ii)In while loop,while(count<=3);{ } is correct? Find correct statement from above ? a.i b.ii c. i & ii d.NoneAns:d

70. Which of the statement is true i) Program requires at least one main function ii) Program does not requires any main function iii) Program requires more than one main function iv) Program requires one & only main functiona. All statements b. i is true c. i and iii are true d. iv is trueAns:d

71. int a[5]; will storesa. May contain Five integers b. Six Integersc. Four Integers d. Exactly Five IntegersAns:d

72. char a[15]=”Welcome here”; then a[7] will storesa. e b. h c.H d. None of the above

Ans:d

73. Find out wrong statements i) if(a=0) ii) For (;i<10;) iii) for(a[i]=0;a[i]!=’/0’;i++) iv) while(a++)a. all of the above b. none of the above c. i only d. i and iv Ans:d

74. int a=125621; This is statement will print

9

Page 10: Documentc

C-program

a.125621 b. a c. int d. None of the aboveAns:d

75. Which of the following statement is correct a) FILE *fptr b) File *fptr; c) file *fptr; d) FILE *fptr;a.None of the above b. All of the above c. iv only d. i and ivAns:c

76. i=0; printf(“%d”,i++); This will print i asa. 0 b. 1 c. -1 d. None of the aboveAns: a

77. ____ are used to stores the values a) Variable b) Function c) Arrays d) Loopsa. i only b. i and iii c. i, ii and iii d. all of the aboveAns:b

78. The Range of char data type is ______ to ______.a. -128 to 127 b. -32768 to 32767 c. 0 to 256 d. -255 to 256 Ans:a

79. C is used fora. System programming b. Object Oriented programmingc. For database storage d. For Only seeing outputAns:a

80. what output will the following statement gives printf(“The answer is:-%f”, (float)a/b); Where a= 10 and b=4a. There is no such ‘C’ statement b. 2.5 c. 2 d. It will give error as cant convert from int to floatAns:b

81. following of which is called as preprocessors in ‘C’a. #define b. #preprocessor c. #stdio.h d. None of aboveAns: a

82. i)Language is case sensitive ii)Write C algorithm we have to write C code in that algorithm Find correct statement from above ?

a. i b. ii c. i & ii d. NoneAns: a83. Which of the following is not the type of operators?

10

Page 11: Documentc

C-program

a. Sizeof Operators b. Cast Operators c. Ternary Operators d. Boolean OperatorsAns:d

84. What will be the value of I in following statement? The statement is I=strcmp(“Jerry”,”Jerry”); a. Strings are equal b. 1 c. TRUE d. 0Ans:d

85. Reusability is not the feature of-----------a. C++ b. Java c. VB.Net d.c

Ans:d

86. Which of the following is console Input/Output function?a. open() b. fclose() c. getche() d. write()Ans: c

87.There are three main areas where text and binary mode files are different?a. Handling of newlines b. Representation of end of filec. Storage of numbers. d. All the aboveAns: d

88. Which of the following is not the standard file pointera. stderr b. stdopen c. stdaux d. stdprnAns: b

89. What is the use of fflusha. It is used to flushout the buffer. b. It is used to flushout the contents of filec. It is used to flushout the program d. It is used to flushout the contants of programAns:a

90. _____ is array of pointers to strings a.argc b.args c.argp d.argvAns:d

91. feof() is a macro which returns a-------if end of file is not reached a.0 b.1 c.-1 d.none of the aboveAns:d

11

Page 12: Documentc

C-program

92. exit() function comes under which header file?a.conio.h b.manip.h c.stdio.h d. process.hAns:d

93. What is the use of sprintf()a. Writes the ouput to string. b. Writes the output to an array of charactersc. Writes the output the file d. Writes the output to screenAns:b

94. i)if for(int i=0;i<10;i++); is correct? ii)There is no difference between declaration and definition of structure Find correct statement from above ? a.i b.ii c. i & ii d.NoneAns:d

95. Which of the following is the application of structure?a. Changing the size of cursor b. Sending the output to printerc. Checking the memory size of the computer d. All the aboveAns:d

96. If we construct an ------------------- it would contain a number of addresses.a.Array b. Array of addresses c. Array of pointers to variables d. Array of pointersAns:d

97. what is the use of strcmpi?a. Compares two strings with regard to case. b. Compares first i characters of string.c. Compares two strings d. Compares two strings without regard to caseAns:d

98. i)<conio.h>stands for console input-out headerfile ii)If int square(),it is a Standard Library function? Find correct statement from above ?a.i b.ii c.i & ii d.NoneAns.a

99. Which of the following operation on pointers will work out?12

Page 13: Documentc

C-program

a. Addition of two pointers b. Multiplication of a pointer with a constantc. Division of a pointer with a constant d. none of the aboveAns:d

100. On some occasions it may be desirable to cause a defined name to become undefined. This can be accomplished by means of -------------directive.a.#undefine b. #undef c. #undefined d. #undefinAns:b

101. Macros can have-------------a. arguments b. variables c. parameters d. constantsAns:a

102. Which of the following is not the processor?a. Debugger b. Editor c. Preprocessor d. CompilerAns:a

103. Which of the following variable type have the default initial value of zero?a. Static & External b. External & Automatic c. Automatic & Register d. Register & StaticAns:a

104. Give the range of long unsigned inta.0 to 42949 b.0 to 65535 c.0 to 32768 d.None of the aboveAns:a

105. Which operator is used with goto statement a. : b. ; c. ! d. &

Ans: a

106. Break actually associated with------------- a.while b.if c.switch d.do-whileAns:c

107. Which of the following is not the type of logical operatorsa. & and | b. && c. || d. !Ans:a108. i)The Register storage class variables cannot hold float value ii)Most of the

13

Page 14: Documentc

C-program

times we need to use atomatic storage class variables Find correct statement from above ?

a. i b. ii c. i & ii d. noneAns:d

109. Library functions are classified into---------------------a. Console I/O functions b. Disk I/O functions c. Port I/O functions d. All the aboveAns:d

110. Which the conversion character for unsigned hexadecimal?a. %uh b. %ux c. %uf d. %xAns:d

111. Which of the following are main types of Disk I/O functions?a. Text and Binary b. Formatted and Unformattedc. Input and Output d. High level and Low levelAns:d

112. What is the use of w+ file opening mode?a. Serches file. If the file exist, loads it into memory and sets up a pointer which

points to the first character in it.b. Serches file. If the file exists, its contents are overwritten.c. Searches file. If the file exists, its contents are destroyed. If the file does’t

exist a new file is created.Returns Null, ifd. None of the above

Ans:c

113. Which of the following is not the type of instruction?a. Arithmetic instruction b. Type declaration instructionc. Control Instruction d. Input InstructionAns:d

114. What is the rule for constructing real constantsa. A real constant must have at least one digit. b. It must have a decimal pointc. Default sign is positive d.All the AboveAns:d

115. Language falling in the category of C is---------------

14

Page 15: Documentc

C-program

a. C++ b. Java c. Vb.net d.PascalAns:d

116. What is ‘C’a. ‘C’ is a programming language b. ‘C’ is a English like languagec. ‘C’ is a middle level language d. All the aboveAns:d

117. i)If the CPU registers are not available,you can use static storage variables ii)C Accepts Two Diamentional Array Find correct statement from above ?

a. i b. ii c. i & ii d.NoneAns:b 118. ferror() reports any error that might have occurred during-------operation on file.a.read b.write c. read/write d. There is no such functionAns:d

119. What is the use of gotoxy() function in C?a. There is no such function in C b. There is no such function in Cc. It places the cursor at the top of the screen d. It places the cursor at appropriate position on the screen.Ans:d

120. fputs()us used toa. Write the character b. Write the numbers c. Write the string d. write the contents of the array to the diskAns:d

121. What will be the output of following program #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }a.23 b.45 c.60 d.NoneAns:d

122. What will be the output of following program main() { char *p="hai

15

Page 16: Documentc

C-program

friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }a. ibj!gs jfoet b. hai friend c. jidkf. Kdjf d. jilkjssl;mAns:a

123. What will be the output of following program? #include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); } a.23 b.50 c.64 d.87Ans:b

124. What will be the output of following program? #define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }a.23 b.45 c.100 d.87Ans:c

125. What will be the output of following program main() { 100; printf("%d\n",100); }a.23 b.45 c.100 d.64Ans:c

126. What will be the output of following program main() { clrscr(); } clrscr();a. No output/error b. main( ) c.100 d.64Ans:a

127. What will be the output of following program? enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }a. 0..1..2 b. 2..1..0 c. 1..2..0 d.100Ans:a

128. i)C Accepts Multidiamentional Array ii)C Accepts Pointer with Array Find correct statement from above ?

a. i b. ii c. i & ii d.NoneAns:c

129. What will be the output of following program? void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }a. 0..1..2 b. 4..2 c. 1..2..0 d.100Ans:b130. What will be the output of following program? main() { char *p;

16

Page 17: Documentc

C-program

p="Hello"; printf("%c\n",*&*p); } a. H b. l c. o d. l

Ans:a

131. C Language has beenDevelped by a. Ken Thompson b. Dennis Ritchie c. Peter Norton d. Martin Richards Ans:b

132. C Language has beenDevelped at a. Micorosoft b. IBM c. AT & T Bell Labs d. Borland Ans: c

133. C can be on a. Ms-Dos b. Unix c. Linux d.All the AboveAns:d

134. i)Datatypes float and double are same ii)Printf() used to print on the Screen Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:b

135. C programs are converted into machine Language with help of a. An Interpreter b. A Compiler c. An Operating System d.none of the leftAns:b

136. A character variable can at A time store a.1 character b.8 characters c.254 characters d.None of the leftAns;a

137. The Maximum value that an integer constant can have is a. -32767 b.1.70E+38 c. 32767 d. -1.70E+38

Ans:c

138. A C Variable cannot start with

17

Page 18: Documentc

C-program

a.A Number b. An Alphabet c. A Special Symbol d. Option 1 AND Option 3 Ans:d

139. If a is an integer variable,a=5/2;will return value a. 2 b.2.5 c.3 d.0

Ans;a

140. The expression,A=7/22*(3.14+2)*3/5;evaluates to a.8.28 b.6.28 c.3.14 d.0Ans:d

141. C is a Very Popular Language why? a. Platform Independent b. Object Oriented c. Easy to Use and Simple d. All The Left Ans:c

142. i)Scanf("%s",a)is wrong? ii)i++ and ++i are same Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:d

143. if a=10 then,if(a%3) produce the value a.2 b.3 c.1 d.0Ans:c

144. if a=13.24 then,if(a%3) produce the value a.2 b.3 c.0 d.1Ans:d

145. It is a Prechechecking loop a. for loop b. while loop c. do-while loop d. None of The Left Ans:b

146. It is a Postchechecking loop a. for loop b. while loop c. do-while loop d. None of The Left Ans:c

147. This keyword allows us passing statements inside the loop

18

Page 19: Documentc

C-program

a. break b. exit c. continue d. None of the AboveAns:c

148. This keyword allows us jump statements outside the loop a. break b. exit c. continue d. None of the AboveAns:a

149. do-while loop useful when we want loopmust be executed a. Only Once b. Morethan once c. Atleast Once d. None of The LeftAns:c

150. i)if Scanf("%c",a), the variable 'a ' accepts characters ii)char name='AJAY' Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:d

151. How many parts in For Loop? a. 1 b. 2 c. 0 d.3

Ans:d

152. The break statement is used to exit from a. if statement b. for loop c. a program d. main function Ans:c

153. This function return single character from input device a. putchar b. getchar c. putc d. getc

Ans:d

154. This function return single character to output device a. putchar b. getchar c. putc d. getc

Ans:c

155. this function return single character from standard Inputdevice a. putchar b. getchar c. putc d. getc

Ans:b

156. his function return single character to standard outputdevice

19

Page 20: Documentc

C-program

a. putchar b. getchar c. putc d. getc Ans:a

157. This function accepts only String values. a. getchar b.getc c.gets d. scanf("%c",&a) Ans:c

158. This function prints only string values a. putchar b. putc c. printf d.putsAns:d

159. i)if (a==10); is Wrong? ii)int Datatype accepts decimals Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:d

160. It is a standard Library function a. exit() b. get() c. display() d. None of The Left Ans:a

161. void means a. function b. produce return value c. no Return value d. None of The Left Ans;c

162. In Pointer,'*' is represent a. Address Operator b. value of address c. Address of Address d. None of The Left Ans:b

163. In Pointer,'&' is represnet a. Address Operator b. value of address c. Address of Address d. None of The Left Ans:a

164. An Array means a. set of values b. set of address c. set of datatypes d. None of The above Ans:a

165. An Array starts from a. value b. address c. index d. None of The Left

20

Page 21: Documentc

C-program

Ans:c

166. How Many Types of Sorting is available? a. 1 b. 2 c. 3 d. 0

Ans:c

167. int num[5],here Maximum how many values store? a. 5 b. 1 c.6 d.0Ans:a

168. i)break and continue keyword only used the loop only ii)No commasor or blanks are allowed within a variablename Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:b

169. FILE IS A a. Keyword b. commands c. structure d. None of The Left Ans:c

170. fopen() is used to a. close the file b. exit from the file c. print on the file d. Open a File Ans:d

171. fclose() is used to a. close a file b. exit from the file c. print on the file d. Open a File Ans:a

172. fgetc() used to a. read the numbers b. read the characters c. write the characters d. None of The Left Ans:b

173. fputc()used to a. read the character b. write the numbers c. read the numbers d. write the characters Ans:d

174. if fopen("js.c","r"),here "r" means? a. random only b. read only c. resize only d. None of The Left

21

Page 22: Documentc

C-program

Ans:b

175. if fopen("js.c","w"),here "w" means? a. With Open b. OverWrite c. wrire only d. None of The Left Ans:c

176. fgets()is used to a. read the character b. read the characters c. read the numbers d. read contents of the array from the disk Ans:d

177. i)Is this array correct int num(10)? ii)char name[3]={"ABC","BCA","CBA","CAB"}; is correct? Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:d

178. i)strlen()used to Finds length of string ii)strlwr()used to Converts string to lowercase Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

179. i)strcat()used to appends one string at the end of another ii)strcpy()used to copies a string to another Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

180. i)strcmp()used to cmpares two strings ii)strrev()used to reverse string Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

181. i)strdup()used to duplicates a string ii)strupr()used to converts a string to uppercase Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

182. i)strncpy()used to copies one string to another ii)strchr()used to finds a string Find correct statement from above ?

22

Page 23: Documentc

C-program

a. i b.ii c. i & ii d.NoneAns:d

183. i)structures is a set of datatypes ii)Nested Structure is one structure with another structure Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

184. i)Structures accepts arrays ii)structures accepts Pointers Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

185. i)structures accpets string functions ii)structure is a datatype of c Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

186. i)structures'S important feature is database management ii)structures accepts pointer and array in same programe Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

187.i)structures accepts all datatypes ii)structures is a one of the Main feature of C Language Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:c

188. Which of the following is console Input/Output fuction?a. open() b. fclose() c. getche() d. write()Ans:c

189. i)In do-while loop, do{while(i<count)}is correct? ii)10. if for(int i=0;i<10;i++); is correct? Find correct statement from above ?

a. i b.ii c. i & ii d.NoneAns:d

190. i)There is no difference between declaration and definition of structure ii)<conio.h>stands for console input-out headerfile Find correct statement from

23

Page 24: Documentc

C-program

above ? a. i b.ii c. i & ii d.None

Ans:b

191. i)printf and scanf functions are built in functions in ‘C’ ii)There is no difference between constants and variables Which answer is suitable for abow sentences ?

a. i b.ii c. i & ii d.NoneAns:a

192. len(s) function comes under which header file? a. Stringio.h b. String.h c. Stringinput.h d. Stringoutput.hAns:b

193. To compile the file we have to use the short cut key as a. Alt+F9 b. Ctrl+F9 c. F5 d.F9Ans:a

194. To execute the file we have to use the short cut key as a. Alt+F9 b. Ctrl+F9 c. Ctrl+F7 d. Alt+F8Ans:b

195. What output will the following statement gives Sizeof(int)a.2 b.4 c.1 d.256Ans:a

196. What output will the following statement gives Printf(“The answer is=%d”,a%b); Where a=25 and b=10 a.2.5 b.2 c.5 d. None of theseAns:c

197. i)There is no difference between while and do-while ii)‘C’ Language is case sensitive Which answer is suitable for abow sentences ?

a. i b.ii c. i & ii d.NoneAns:b

198. i)We can give keyword names to variables ii)A semicolon must follow the closing brace in the structure type declaration. Which answer is suitable for abow

24

Page 25: Documentc

C-program

sentences ? a. i b.ii c. i & ii d.None

Ans:b

199. The range of float is.a. -128 to 127 b.-32768 to 32768 c. 3.4e-38 to 3.4e+38 d. 1.7e38 to 1.7e+38Ans:c

200. i)We can create our own header file and put our own functions in it. ii)We can store 1000 values by using only one variable in c language Which answer is suitable for abow sentences ?

a. i b.ii c. i & ii d.NoneAns:c

201. Strcat function is used fora. To concatenate the strings b. To compare the stringc. To duplicate the string d. To copy one string to anotherAns:a

202. i)We have to give semicolon after for statement ii)Array comes under secondary constants Which answer is suitable for abow sentences ?

a. i b.ii c. i & ii d.NoneAns:b

203. The scope of global variable isa. Only in one function b. May used outside the functionc. There is no such variable in ‘C’ d. We can use variable to store values onlyAns:b

204. After Compiling the C Source File TC creates a new file as a. .exe b. .bak c. .obj d. .cAns:c

205. _____ returns nothinga. int b.Float c. Char d. void

Ans:d

206. Which of the loop will execute at least one time a. For b. While c. Do…While d. None of the above

25

Page 26: Documentc

C-program

Ans:c

207. a=’K’; printf(“%d”,a); This will print a. K b. ‘K’ c. ASCII value of K d. None of these

Ans:c

208.______ is used to denote unsigned integer a. %d b. %f c. %u d. %c

Ans:c

209. int a[5]; will stores a. Five characters b. Four characters c. Four Integers d. Five Integers Ans:d

210. _____ refers to memory address a. & b. * c. = d. ++

Ans:a

211. Find out wrong statements i.if(a=0) ii.For (;i<10;) iii.for(a[i]=0;a[i]!=’/0’;i++) iv.while(a++) a. all of the above b. none of the above c. i only d. i and iv Ans: d

212. int a=125621; This is statement will print a. 125621 b. a c. int d. none of the above

Ans: d

213. isupper() is used for a. Changing the character to uppercase b. Checking the case is upper or not-Ansc. For both d. None of the aboveAns:b

214. The Range of char data type is ______ to ______. a. -128 to 127 b. -32768 to 32767 c. 0 to 256 d. -255 to 256Ans:a

215. The Conversion character used for single data item is. a. %s b. %c c. %d d. %f

26

Page 27: Documentc

C-program

Ans:b

216. Escape sequence used for new line is. a. \n b. \t c.\a d. \nlAns:a

217. i)Run time declaration is allowed in C ii)We can’t give variable name bigger than 8 characters Which answer is suitable for abow sentences ?

a. i b.ii c. i & ii d.NoneAns:d

218. Which of the following symbol is used to denote a pre-processor statement? a. ! b. # c. ~ d. ;

Ans:b

219. Character constants should be enclosed between ____________a. Single quotes b. Double quotes c. Both a and b d. None of theseAns:a

220. Which of the following is invalid? a. ‘’ b. “ “ c. ‘a’ d. ‘abc’

Ans:d

221. The maximum length of a variable in C is ___ a. 8 b. 16 c. 32 d. 64

Ans:d

222. The operator && is an example for ___ operator. a. Assignment b. Increment c. Logical d. Rational Ans:c 223. The operator / can be applied to a.integer values b. float values c. double values d. All of these Ans:d

224. The equality operator is represented by a. := b. .EQ. c. = d. ==

27

Page 28: Documentc

C-program

Ans:d

225. What will be the output of the expression 11 ^ 5? a. 5 b. 6 c. 11 d. None of theseAns:d

226. In the C language 'a’ represents a. a digit b. an integer c. a character d. a wordAns:c

227. The number of the relational operators in the C language is a. Four b. Six c. Three d. One

Ans:b

228. The continue command cannot be used with a. for b. switch c. do d. whileAns:b

229. Maximum number of elements in the array declaration int a[5][8] is a. 28 b. 32 c. 35 d. 40

Ans:d

230.If the size of the array is less than the number of initializers then, a. Extra values are being ignored b. Generates an error messagec. Size of Array is increased d. Size is neglected when values are given Ans:b

231. Array subscripts in C always start at a. -1 b. 1 c. 0 d. Value provided by user

Ans:c

232. Z= (10<20)? 500:1000 then Z=? a. 10 b. 20 c. 500 d.1000

Ans:c

233. Integer Division results in a. Rounding the fractional part b. truncating the fractional part

28

Page 29: Documentc

C-program

c. Floating value d. An Error is generated Ans:b

234. The type cast operator is a. (type) b. cast() c. // d.Ans:a

235. What punctuation ends most lines of C code?a. . . b. ; c. : d. '

Ans:b

236. What punctuation is used to signal the beginning and end of code blocks?a. { } b. -> and <- c. BEGIN and END d. (and)Ans:a

237. Which of the following comes under numerical value?a. 1 b. 66 c. 0.1 d. All of the above

Ans:d

238. Which of the following is the boolean operator for logical-and?a. & b. && c. | d. |&

Ans:b

239. Which of the following shows the correct syntax for an if statement?a. if expression b. if{ expression c. if( expression) d. expression if

Ans:c

240. When does the code block following while(x<100) execute?a. When x is less than one hundred b. When x is greater than one hundredc. When x is equal to one hundred d. While it wishesAns:a

241. Which is not a loop structure?a. For b. Do while c. While d. Repeat Until Ans:d

242. Which is not a valid version of C out of the following?a. ANSI b. Micro c. UnixC d. Turbo

29

Page 30: Documentc

C-program

Ans:b

243. C is modified version of which languagesa. C++ b. VC++ c. 0 B and BPCL d. C++ and VC++

Ans:c

244. Is C a case sensitive language?a. TRUE b. FALSE c. Partially True d. None of the aboveAns:a

245. What is linker?a. Linker is a program which links the standard library files to the object code

generated by the compiler to build anb. Linker is a module which links one file to another.c. Linker links an object code to a source code.d. None of the above.

Ans:a

246. What do header files consist of?a. Examples of functions. b. Prototype examples. c. Function prototypes. d. Programs.Ans:d

247. What is the extension of header files?a. .h b. .hdr c. .hr d. .he

Ans:a

248. What is the extension of C source files?a. .cpp b. .c c. .csource d.src

Ans:b

249. What is the extension of object code developed by the compiler?a. .cmp b. .object c. .obj d. none of the above

Ans:c

250. What is the extension of executable code?a. .obj b. .exe c. .c d. none of the above

30

Page 31: Documentc

C-program

Ans:b

251. What is the extension of library files?a. .lbr b. .lib c. .lnk d. none of the above

Ans:b

252. Is it possible to have nested comments?a. Sometimes b. Yes c. Many times d. NoAns:d

253. Which function is considered as the entry point of the program?a. void main() b. main() c. main d. void main Ans:b

254. What are constants?a. Constants are those variables which do not change their value throughout

the program. b. Constants are those values which do not change their value throughout the

program. c. Constants are those values which do not change their value for a long time. d. None of the above.

Ans:a

255. C Language came into existence in the year a. 1972 b. 1957 c. 1983 d. 1971

Ans:a

256. This statement can cause program control to endup almost antwherein the program. a. continue b. goto c.break d. exitAns:b

257. What is a pointera. A pointer is a memory variable which stores the memory address of another

31

Page 32: Documentc

C-program

variableb. A pointer is a variable which points to another variablec. A pointer is an extraordinary variable.d. None of the above.

Ans:a

258. What do you mean by recursiona. Recursion is a method in which a function calls another functionb. Recursion is the method by which a function calls itselfc. Recursion is a method of circular referenced. Recursion is a way of calling a function

Ans:b

259. What is the default way of passing the arguments in a functiona. Call by value b. Call by referencec. Call by both value and reference d. Call by variableAns:a

260. What are functionsa. Function in ‘C’ is a set of blocksb. Function in ‘C’ is usually defined as a named block of statements which

performs a specified task or subtask.c. Function in ‘C’ is a named set of modulesd. Function in ‘C’ is a named set of statements

Ans:b

261. What is the purpose of fgetc() functiona. The fgetc() function gets a character from a stream b. The fgetc() function gets a number from a streamc. The fgetc() function gets a number and a character from a streamd. None of the above.

Ans:c

262. The getche() functiona. Does not echo the input value on the screen b. Is a display function.

32

Page 33: Documentc

C-program

c. Is not a valid function of C. d. Echoes the input value on the screen.Ans:d

263. What are arraysa. An array is a linear and homogenous data structureb. An array is a non-linear and homogenous data structurec. An array is a group of elements.d. None of the above.

Ans:a

264. What is getch() functiona. This function works like ‘wait’ or ‘pause’b. This function reads a single character from a std input such as a keyboard

but it does not display or echo the characterc. This function accepts a character with the CR (carriage return).d. This function accepts a string.

Ans:b

265. Name the functions which are available in character I/O formata. getch(), getche(), getchar() b. getc(), clrscr()c. gets(), strcpy() d. None of the aboveAns:a

266. Is there any String datatype in Ca. Yes b. No. The keyword is ‘Strings’, not ‘String’. c. No. The keyword is ‘Str’, not ‘String’. d. NoAns:d

267. What are escape sequencesa. These are the special characters which are enclosed with backslashb. These are the special characters which start with frontslashc. These are the special characters which start with backslashd. None of the above.

Ans:a

268. What are Character Constants?a. A character constant is a single character enclosed in single quotation marks.

33

Page 34: Documentc

C-program

b. A character constant is a single character.c. A character constant is a character with numeric value.d. None of the above.

Ans:a

269. What are Floating Point Constants?a. A floating point constant is a decimal number.

b. A floating point constant is a base 10 number that contains either a decimal point or an expression.

c. A floating point constant is a special number.

d. None of the above.

Ans:b

34