NEW
Font size
WorksheetsCode X Trade
Total questions: 15
Worksheet time: 8mins
How many times i value is checked in the following C program
#include <stdio.h>
int main()
{
int i = 0;
while (i < 3)
i++;
printf("In while loop\n");
}
2
3
4
1
What will be output if you will compile and execute the following c code?
#include<stdio.h>
int main(){
int array[3]={5};
int i;
for(i=0;i<=2;i++)
printf("%d ",array[i]);
return 0;
}
5 garbage garbage
5 0 0
5 null null
compiler error
What will be the output of the following C code?
#include <stdio.h>
void main(){
int a = 1, b = 1, c;
c = a++ + b;
printf("%d, %d", a, b);
}
1,1
2,1
1,2
2,2
Predict the output for the following c code
#include<stdio.h>
void main(){
char s[]="abcd";
for(int i=0;i=<4;++i){
printf("\t%d",i);
}
}
syntax error
abcd
0123
0 1 2 3
Predict the output for the following c code
#include <stdio.h>
void main(){
int result= 1 < 2 ? 2:1;
printf("%d",result);
}
1
error
True
2
What is the output of the following python code?
var1 = 1
var2 = 2'
var3 = "3"
print(var1 + var2 + var3)
6
33
123
Error
What is the output of the following python code?
listOne = [20, 40, 60, 80]
listTwo = [20, 40, 60, 80]
print(listOne == listTwo)
print(listOne is listTwo)
True True
True False
False True
False False
What is the output of the following python code?
var= "James Bond"
print(var[2::-1])
mes
aj
maj
dnoB se
What is the output of the following python code?
var = "James" *2 * 3
print(var)
JamesJamesJamesJamesJamesJames
JamesJamesJames
JamesJames
error
Find the output for the given python program:
list1 = [[1, 2], [3, 4]]
list2 = list1
list2[0][0] = 0
print(list1)
[1, 2, 3, 4]
[0, 2, 3, 4]
[[0, 2],[ 3, 4]]
[[1, 2], [3, 4]]
predict the next value
1, 2, 3, 5, 7, 11, _
14
13
9
12
If a = 1, b = 2, c = 3.......z = 26 what is the value of t+j+p?
33
51
46
52
How many two digit numbers have their square ending with 8.
13
7
0
11
Find the missing term 6, ?, 21, 33, 48
14
20
12
18
Complete the sequence
A, e, i, m, q, u,,
Y,c
G,i
B,f
None
