X Computer Assignment ch 11-15
X Computer Assignment ch 11-15
Chapter 11
19. It is not necessary to include stdio.h file while using ….. function.
(A) printf( ) (B) getchar( ) (C) putchar( ) (D) scanf( )
20. ……. function is used when the user don’t want to show a character typed in by him on the
screen.
(A) getc( ) (B) gets( ) (C) getch( ) (D) getchar( )
21. In scanf( ) statement, the general format of control string is …….. .
(A) /lp (B) +lp (C) %lp (D) -lp
22. ……… format specifier in scanf( ) reads a short integer.
(A) %h (B) %u (C) %g (D) %1d
23. What will be the value of variable a, b and c if ‘a’ 75.5 21 is given is given as input for
Scanf(“%c %d %d”, &a, &b, &c); ?
(A) ‘a’ 75.5 (B) ‘a’ 21 (C) ‘a’ 75 5 (D) ‘a’ 75 21
24. Which of the following is not a function for output ?
(A) puts( ) (B) putchar( ) (C) printf( ) (D) scanf( )
25. …… format specifier in printf( ) is used to print integer in hexadecimal form.
(A) %f (B) %o (C) %x (D) %ld
26. %e format specifier of printf ( ) is used to print ……… .
(A) integer in hexadecimal form
(B) a floating point value in exponent form
(C) a floating point value without exponent
(D) integer in octal form
27. Which of the following input is valid for scanf(“%[a-z A-Z]”, student_name); ?
(A) Vani M shah (B) Vani M. Shah
(C) Vani M Shah/ Vani Mahesh Shah (D) All of the given
28. String can be left justified using ……. sign in printf( ).
(A) left (B) right (C) center (D) none of the given
29. puts( ) function do not display …….. on screen.
(A) string (B) character (C) null character (D) all of the given
30. The scanf( ) stands for……… .
(A) scan file (B) scan formatted
(C) scanning & formatting (D) none of the given
31. When ……. function is executed, character will be displayed on the monitor.
(A) putchar( ) (B) puts( ) (C) gets( ) (D) getchar( )
32. Which of the following are inbuild functions ?
(A) scanf ( ), printf( ) (B) getchar( ), gets( ), getch( )
(C) puts( ), putchar( ) (D) all of the given
33. %Lf format specifier of printf( ) is used to print ………… .
(A) long double (B) long integer
(C) short integer (D) a floating point value in exponent form
34. …..format specifier in scanf( ) represents unsigned integer.
(A) %d (B) %ld (C) %u (D) %h
35. %s format specifier in scanf( ) reads a ………….. .
(A) character (B) string (C) short integer (D) long integer
36. Each string in C ends with ………… .
(A) . (B) \0 (C) \t (D) \n
Chapter 13
37. Which of the following is the simplest form of decision structure statement ?
(A) if (B) if….else (C) Nested….if (D) else….if ladder
38. if statement is considered to be ……statement when the test expression part of if ends with a
semicolon.
(A) dull (B) null (C) extra (D) conditional
39. …… is used to perform some process when test expression is evaluated to true and some other
processes if test expression is evaluated to false.
(A) if…..else (B) Nested…if (C) if (D) else….if ladder
40. There is no need to use braces around the statement block of ……..statement .
(A) switch (B) if (C) if…..else (D) Nested…..if
41. When no case is found during execution of switch statement the …… statement block is
executed.
(A) break (B) default (C) continue (D) none of the given
42. At which of the following places can the default statement be places in switch ?
(A) In the beginning of switch (B) Anywhere in the switch
(C) In the end of switch (D) None of the given
43. What can be ‘first’ in the statement switch(first) ?
(A) Constant (B) variable (C) Expression (D) All of the given
44. When chain of if statements are used together to evaluate multiple decisions, it becomes
…….. statement .
(A) if…..else (B) Nested…..if (C) else….if ladder (D) none of the given
45. …… structure is used to display the message “Student passes” if the marks of student is greater
than 40 otherwise the message “Student failed” .
(A) simple if (B) else……if ladder (C) if….else (D) switch
46. The …… statement is used to terminate the case statement block.
(A)exit (B) break (C) loop (D) stop
47. The switch statement needs only …… argument.
(A) 1 (B) 2 (C) 5 (D) 257
48. Switch is used inplace of……… .
(A) if (B) if….else (C) else….if ladder (D) Nested…..if
49. The test expression of else….if ladder is evaluated from the …….. in the ladder.
(A) top to bottom (B) bottom to top (C) left to right (D) right to left
50. C programming language assumes …… values as false.
(A) non-zero (B) zero (C) null (D) both B & C
51. Which of the following cannot be used as test expression with if ?
(A) n > 5 (B) n < 5 (C) n=5 (D) n==5
52. C language provides …….. basic types of decision structure statement ?
(A) 2 (B) 3 (C) 4 (D) 5
53. Test expression of if statement contains ……., the result of the same may be true or false.
(A) logical operator (B) relational operator (C) logical expression (D) bitwise operator
54. It is necessary to write compound statements of if in ……… .
(A) ( ) (B) [ ] (C) < > (D){ }
55. In simple if statement, there is …….. statement block.
(A) only one (B) two (C) multiple (D) none of the given
56. C language provides multiway decision statement called …. to simplify program.
(A) if (B) if…..else (C) Nested…..if (D) switch
Chapter 14
57. In looping, the sequence of statements are executed until some …… condition is satisfied.
(A) exit (B) entry (C) if (D) switch
58. …….. is / are exit controlled loop.
(A) for (B) while (C) do….while (D) Both B & C
59. …… in for loop is also known as control variable.
(A) Expression 3 (B) Expression 1 (C) Statement block (D) Expression 2
60. …… in for loop works for initializing value of counter variable.
(A) Expression 1 (B) Expression 2 (C) Expression 3 (D) All of these
61. …… in for loop, is used for checking loop terminating criteria .
(A) Expression 2 (B) Expression 1 (C) Statement block (D) Expression 3
62. All the expressions of for loop are …….. .
(A) compulsory (B) optional (C) conditional (D) operator
63. Which of the following loop is used when number of iterations are not pre-determined ?
(A) while (B) do……while (C) Both A & B (D) for
64. The compound statement of any loop should be written with in …….. .
(A) ( ) (B) { } (C) [ ] (D) ({ })
65. The …… statement terminates the loop.
(A) break (B) continue (C) default (D) Exit
66. In …. Loop, continue statement transfer the control to the test expression used with while
statement .
(A) for (B) while (C) do….while (D) both B & C
67. C program runs forever when …….. construct is used.
(A) for (; ;) (B) for (;) (C) for (; ; ;) (D) for (;);
68. Which of the following is not a loop construct in C ?
(A) for (B) while (C) do…..while (D) from
69. C language provides ….. types of loop control structures .
(A) 4 (B) 3 (C) 1 (D) 2
70. The for loop contains expressions in ………. .
(A) ( ) (B) { } (C) [ ] (D) {( )}
71. In …… loop, the test expression is checked after executing body of loop.
(A) for (B) while (C) do…..while (D) both B & C
72. Any loop in a program becomes ….. loop if it runs forever and program control never
comes out of it.
(A) entry (B) exit (C) infinite (D) incoming
Chapter 15