Whats the output of this code :
#include <stdio> {
int main() {
int i = 1;
while (i <= 10) {
printf("%d ", i);
i += 2;
}
return 0;
}
1.1 Programming C
Quiz
•
Others
•
University
•
Easy
Salma AG
Used 5+ times
FREE Resource
6 questions
Show all answers
1.
OPEN ENDED QUESTION
1 min • 5 pts
Whats the output of this code :
#include <stdio> {
int main() {
int i = 1;
while (i <= 10) {
printf("%d ", i);
i += 2;
}
return 0;
}
Evaluate responses using AI:
OFF
2.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
1. What is the output of the following code snippet?
c
#include<stdio.h>
int main() {
int i = 0;
while (i < 5) {
if (i == 3)
continue;
printf("%d ", i);
i++;
}
return 0;
}
a) 0 1 2 3 4
b) 0 1 2 4
c) 0 1 2
d) Compilation error
3.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
2. What is the output of the following code snippet?
c
#include<stdio.h>
int main() {
int i = 10;
do {
printf("%d ", i);
i--;
} while (i > 5);
return 0;
}
a) 10 9 8 7 6
b) 10 9 8
10
Compilation error
4.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
3. What is the output of the following code snippet?
c
#include<stdio.h>
int main() {
int i = 0, j = 0;
for (i = 0; i < 5; i++) {
for (j = i; j < 5; j++) {
printf("* ");
}
printf("\n");
}
return 0;
}
d) Compilation error
5.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
4. What is the output of the following code sni #include<stdio.h>
int main() {
int i = 0;
for (i = 0; i < 5; i++) {
if (i == 2)
break;
printf("%d ", i);
}
return 0;
}
a) 0 1
b) 0 1 2
c) 0 1 2 3 4
d) Compilation error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
5. What is the output of the following code snippet?
c
#include<stdio.h>
int main() {
int i = 10;
while (i > 5) {
printf("%d ", i);
i++;
}
return 0;
}
a) Infinite loop
b) Compilation error
c) No output
d) 10
10 questions
Coronary angiography
Quiz
•
University
10 questions
so and such
Quiz
•
University
6 questions
Log dan Pemrograman Kel 1
Quiz
•
University
10 questions
pre test pbo - week 1
Quiz
•
University
10 questions
Analisis Real
Quiz
•
University
10 questions
GREEN CHEMISTRY
Quiz
•
University
10 questions
Math Skills Challenge for Grade 6
Quiz
•
University
10 questions
Disaster management
Quiz
•
University
10 questions
Chains by Laurie Halse Anderson Chapters 1-3 Quiz
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
12 questions
Multiplying Fractions
Quiz
•
6th Grade
30 questions
Biology Regents Review #1
Quiz
•
9th Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review: Structure & Function
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University
16 questions
Chapter 8 - Getting Along with your Supervisor
Quiz
•
3rd Grade - Professio...
6 questions
Railroad Operations and Classifications Quiz
Quiz
•
University
71 questions
Logos
Quiz
•
3rd Grade - University
8 questions
Mali - Geography
Quiz
•
University