PPS - Unit-3 - MCQ
PPS - Unit-3 - MCQ
(a) while
(b) goto
(c) for
(d) do while
(a) break
(b) goto
(c) continue
(d) switch
(a) while
(b) switch
(c) for
(d) do while
(a) return
(b) break
(c) exit
(a) while
(b) goto
(c) for
(d) do while
void main()
int i = 1;
for(;;)
if(i > 5)
break;
printf("%d",i++);
(a) 1 2 3 4 5
(c) 1 2 3 4 5 6
(d) no output
(a) "break" and "continue" can be used in "for", "while", "do-while" loop body and "switch"
body.
(b) "break" and "continue" can be used in "for", "while" and "do-while" loop body. But only
"break" can be used in "switch" body.
(c ) "break" and "continue" can be used in "for", "while" and "do-while" loop body. Besides,
"continue" and "break" can be used in "switch" and "if-else" body.
(d) "break" can be used in "for", "while" and "do-while" loop body.
int x;
{ }
(a) 10
(b) 0
(c) 9
(d) 1
void main()
{int i;
{ printf(“ %d”, i}
(a) 1 to 10
(b) 11
(c) Error
(d) None
int main()
int i = 1024;
for (; i; i >>= 1)
printf("QUIZ");
return 0;
(a) 10
(b) 11
(c) infinite
(d) Error
(a) 0
(b) 1
(c) infinite
void main()
for(;;)
{
printf("QUIZ");
break;
(a) 1 time
(b) infinite
(c) No output
(a) float
(b) int
(c) void
(d) double
IV. If a function is not returning any value then it should be int type
(a) I,II,III
(b) I,II,IV
(c) I,II,IV
(d) I,III
Answer: Option (d)
(d) None
(a) Pass By Value copies the variable value in one more memory location.
(c) Pass By Value protects your source or original variables from changes in outside
functions or called functions.
(c) no function
(d) n no of function
18. which statement is used to transfer back the control to the calling function
(a) back
(b) goto
(c) return
(d) switch
void main()
int i = 0, n = 0;
do
if(i % 5 == 0)
printf("%d",n);
n++;
++i;
}while(i<10);
printf("%d",n);
(a) 01
(b) 12
(c) 012
(d) No output
#include<stdio.h>
int main()
{printf("Hello");
main();
return 0;
(c) no output
(a) true
(b) false
{ int i=0;
char c='0';
while(i<10)
printf("%c",c+i);
i++;}
}
(a) 0123456789
(b) 123456789
(c) opqrstuvw
(d) None
(a) auto
(b) static
(c) register
(d) extern
(a) true
(b) false
(c) Tree
(d) Trail
(a) True
(b) False
#include<stdio.h>
void main()
printf("%d",i--);
if(i)
main();
(a) 4444
(b) 3210
(c) infinite
(d) 4321
(b) Queue
(c) LIFO
(d) Tree
int fun();
int i;
i = fun();
printf("%d\n", i);
}
int fun()
return(_AX);
(a) 0
(b) garbage
(c) no output
(d) 1990
int main()
Test(i, &j);
return 0;
i = i*i;
*j = *j**j;
(a) 5,4
(b) 25,4
(c) 5,2
(d) Error
(a) Name
(c) argument
34. It is necessary to have initialization,testing, and updating expression within the for
statement
(a) True
(b) false
(a) True
(b) False
36. Output?
void main()
int i=5;
for(i=1;i<=10;i++)
{ if(i==5)
continue;
printf("%d", i);
}}
(a) 12346789110
(b) Error
(c) No output
(d) 1
(a) Yes
(b) No
(c) Maybe
38. Which of the following statement is used to skip some statements in the loop.
(a) break
(b) goto
(c) continue
(d) switch
(a) true
(b) False
(c) May be
(d) None