NEW
Font size
Worksheetsday5
Total questions: 21
Worksheet time: 12mins
What will the result of 'num' variable after execution of the following statements?
int num = 58;
num % = 11;
3
5
8
11
int main()
{
char arr[7]="Network";
printf("%s", arr);
return 0;
}
Network
N
Garbage Value
Compilation error
#include<stdio.h>
int main()
{
float a=0.7;
if(a<0.7)
{
printf("C");
}
else
{
printf("C++");
}
}
C
C++
Compilation Error
None of the these
int main()
{
int a = 1, b=2, c=3;
char d = 0;
if(a,b,c,d)
{
printf("EXAM");
}
}
No Output and No Error
EXAM
Run time error
Compile time error
What will be output of the following c program?
#include<stdio.h>
int main()
{
int max-val=100;
int min-val=10;
int avg-val;
avg-val = max-val + min-val / 2;
printf("%d",avg-val);
}
55
105
60
Compilation error
Input/output function prototypes and macros are defined in which header file?
conio.h
stdlib.h
stdio.h
dos.h
The "\n" character does which of the following operations?
Double line spacing
Character deletion
Character backspace
Places cursor on the next line
The switch statement takes a given integer value then seeks a matching value among a number of _______ statements.
break
case
switch
goto
Which of the following is an exit control statement
for
while
do while
continue
What will be the output of following program ?
Hello
ERROR
No Output
Garbage Value
What is the output of C Program with switch statement or block.?
APACHE HEROHONDA
HEROHONDA
No Output
Compiler error
What is output of below program?
int main()
{
int i;
for(i=0; i<5; ++i++)
{
printf("Hello");
}
return 0;
}
Hello is printed 5 times
Compilation Error
Hello is printed 2 times
Hello is printed 3 times
What will be the output of following program?
Hello
OK
Hello
OK
Error
What does the following code fragment write to the monitor?
Under
Over
Under the limit
Over the limit
#include<stdio.h>
int main()
{
char j=1;
while(j < 5)
{
printf("%d, ", j);
j = j+1;
}
printf("\n");
return 0;
}
1 2 3 ... 127
1 2 3 ... 255
1 2 3 ... 127 128 0 1 2 3 ... infinite times
1, 2, 3, 4
What will print?
s
m
d
e
What will print?
10
20
30
40
What will print?
20
40
60
50
What is the output of this C code?
int main()
{
int i = -5;
int k = i %4;
printf("%d\n", k);
}
Compile time error
-1
1
None
Is this quiz helping you to improve technical skills
yes
no
