Font size
WorksheetsCoding and Debugging
Total questions: 15
Worksheet time: 15mins
What will be the output of this code?
executed
1 executed
0 executed
none of the above
Output:
Enter a number 10
Both are not equal
Find the error and enter the corrected line
(a)
print("abc.DEF".capitalize())
What will be the output of this code?
Abc.def
abc.def
Abc.Def
ABC.DEF
a=65
print("[%c]"%a)
What will be the output of this code?
[a]
a
[A]
[a]
What will be the output of this code?
fun None
fun fun
None fun
error
a=~4
b=a+4
print(b)
What will be the output of this code?
1
-1
2
-2
a="python"
b="pythoN"
print(a>b)
What will be the output of this code?
error
true
false
none of the above
Which of the following declarations is incorrect in python language?
1.xyzp = 5,000,000
2.x y z p = 5000 6000 7000 8000
3.x,y,z,p = 5000, 6000, 7000, 8000
4.x_y_z_p = 5,000,000
1
2
3
4
Find the error and type the corrected line
(a)
What will be the output?
bitterbutter
bitter error
Syntax Error
butter error
What will be the output?
16
Syntax Error
10
(6,10)
#include <stdio.h>
// Assume base address of "StudyHard" to be 1000
int main()
{
printf(5 + "StudyHard");
return 0;
}
What will be the output?
5StudyHard
Study
Hard
error
#include<stdio.h>
void main(){
int a = 10, b = 5, c;
c = a + b / 3;
printf("%d", c);
}
Desired Output : 5
Find the logical error and Type the corrected line of error
(a)
#include <stdio.h>
int main()
{
int x = 10,b=20,c;
x+b=c;
printf("%d", c);
return 0;
}
Output:
30
Find the error and type the corrected line of error
(a)
#include <stdio.h>
int main()
{
int main = 3;
printf("%d", main);
return 0;
}
It will cause a compile-time error
It will cause a run-time error
It will run without any error and prints 3
It will experience infinite looping
