What is the output of the following code snippet?
int x = 10, y = 20;
x > y ? printf("X") : printf("Y");
CODE 4 KITSW ROUND - 2
Quiz
•
Others
•
University
•
Hard
Siddartha vaitla
Used 1+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 10 pts
What is the output of the following code snippet?
int x = 10, y = 20;
x > y ? printf("X") : printf("Y");
A) 10
B) 20
C) Compilation error
D) Y
2.
MULTIPLE CHOICE QUESTION
10 sec • 10 pts
Which statement is used to exit a loop prematurely in C?
A) exit
B) break
C) continue
D) return
3.
MULTIPLE CHOICE QUESTION
10 sec • 10 pts
How many types of decision-making statements are there in C?
A) 2
B) 3
C) 4
D) 5
4.
MULTIPLE CHOICE QUESTION
30 sec • 10 pts
What is the output of the following code snippet?
int x = 5;
if (x > 5)
printf("A");
else if (x < 5)
printf("B");
else
printf("C");
A) A
B) B
C) C
D) No output
5.
MULTIPLE CHOICE QUESTION
30 sec • 10 pts
What is the output of the following code snippet?
int main() {
int x = 5;
while (x > 0) {
printf("%d ", x--);}
return 0; }
54321
12345
55555
4321
6.
MULTIPLE CHOICE QUESTION
30 sec • 10 pts
What is the output of the following code snippet?
int main() {
int i;
for (i = 0; i < 5; i++) {
if (i == 2)
continue;
printf("%d ", i);
}
return 0;
}
0123
01234
0134
1234
7.
MULTIPLE CHOICE QUESTION
10 sec • 10 pts
Which statement is used to terminate the program in C?
A) exit
B) break
C) terminate
D) return
20 questions
ALGORITMA DAN DASAR PEMROGRAMAN
Quiz
•
University
20 questions
Sjmit-Q1-[Workshop-MAR-25]
Quiz
•
12th Grade - University
20 questions
Renal Physiology Quiz
Quiz
•
University
20 questions
GES 212_Logic part
Quiz
•
University
20 questions
R Programming Challenge for BCA Students
Quiz
•
University
22 questions
stator
Quiz
•
University
25 questions
STS Genap PJOK
Quiz
•
5th Grade - University
25 questions
CODE 4 KITSW ROUND – 3
Quiz
•
University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade