
Programming Quiz on C
Authored by Santhoshi V
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the equivalent code of the following statement in WHILE LOOP format?
for (a=1; a<=100; a++)
printf ("%d\n", a * a);
a=1;
while (a<=100)
{
printf ("%d\n", a * a); a++;
}
a=0;
while (a<=100)
{
printf ("%d\n", a * a); a++;
}
a=1;
while (a>=100)
{
printf ("%d\n", a * a); a++;
}
while (a<=100)
{
printf ("%d\n", a * a); a++;
}
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
for (a=1; a<=5; i++)
{
for (b=1; b<=a; b++)
printf("%d",b);
printf("\n");
}
1
1 2
1 2 3
1 2 3 4
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
None
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
int main() {
char str[] = "Hello";
printf("%c", *(str + 1));
return 0;
}
H
e
l
o
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
void fun(int *p) {
*p = *p + 10;
}
int main() {
int a = 5;
fun(&a);
printf("%d", a);
return 0;
}
5
10
15
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
int main() {
int x = 10;
printf("%d %d %d", x++, x++, ++x);
return 0;
}
10 11 13
12 12 12
Undefined behavior
Compilation Error
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?int main() {
int x = 5, y = 10, z = 15;
int *arr[] = {&x, &y, &z};
printf("%d", *arr[1]);
return 0;
}
5
10
15
20
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
int main() {
int a = 3, b = 4;
printf("%d", a+++b);
return 0;
}
7
8
3
Error
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Python Basics
Quiz
•
KG - University
17 questions
Graph Theory Data Structures
Quiz
•
University
20 questions
Basics of programming - Quiz - 01
Quiz
•
University - Professi...
18 questions
Programming in C language
Quiz
•
12th Grade - University
20 questions
Unit 10 - Client - Server model
Quiz
•
12th Grade - University
20 questions
ADMINISTRASI SISTEM JARINGAN
Quiz
•
University
18 questions
CP-String
Quiz
•
University
16 questions
Python Basics
Quiz
•
KG - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade