
C Programming Quiz unit 2

Quiz
•
Computers
•
University
•
Easy
MS CHAUHAN
Used 1+ times
FREE Resource
55 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct syntax for a for loop in C?
for (initialization; condition; increment) { ... }
for (condition; initialization; increment) { ... }
for initialization; condition; increment { ... }
for (initialization condition increment) { ... }
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How many times will the following loop execute? c int i = 0; while (i < 5) { i++; }
4
5
6
Infinite loop
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which statement should be used to skip the current iteration in a loop in C?
break;
continue;
goto;
exit;
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output for the following code? c for(int i=1; i<=3; i++) { for(int j=1; j<=i; j++) { printf("*"); } printf("\n"); }
text *** *** ***
text * ** ***
text * * *
text ** *** ****
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the valid declaration for a 2D integer array with 3 rows and 4 columns?
int arr[3][4];
int arr[4][3];
int arr[3];
int arr[4];
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How is the address of arr[i][j] in a 2D array (row-major order) calculated (assuming array is declared as int arr[M][N];)
base_address + (i*N + j) * sizeof(int)
base_address + (j*M + i) * sizeof(int)
base_address + (j*N + i) * sizeof(int)
base_address + (i*M + j) * sizeof(int)
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following correctly initializes a string in C?
char str[] = "Hello";
char str = "Hello";
Both A and B
char str = "Hello";
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
SAS Informatika Ganjil Kelas 9

Quiz
•
9th Grade - University
58 questions
Web Auth 2

Quiz
•
University
50 questions
Test 2

Quiz
•
University
51 questions
C Programming Quiz

Quiz
•
University
50 questions
TARANG 2023 Technical Quiz

Quiz
•
University
50 questions
Quiz Trivia

Quiz
•
University
50 questions
DS-UNIT-2-Stack Queue

Quiz
•
University
50 questions
Java Quizathon

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University