
Programming Quiz on C

Quiz
•
Computers
•
University
•
Hard
Santhoshi V
Used 2+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Milking Minds 2 17-01-24

Quiz
•
University
20 questions
Computer Fundamental and C Programming Concept

Quiz
•
University
25 questions
Aptitude Competition(FY)

Quiz
•
University
15 questions
Algoritmos y Programación - Introducción a Programación Modular

Quiz
•
University
20 questions
Kuis ALPRO

Quiz
•
University
15 questions
C Pointers 17May2023

Quiz
•
University
20 questions
Pointers

Quiz
•
University
15 questions
C programming

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University