
C Programming Quiz unit 2
Authored by MS CHAUHAN
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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";
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
55 questions
JAVASCRIPT LONG
Quiz
•
University
60 questions
Ôn tập Tin học lớp 3 HK 2
Quiz
•
3rd Grade - University
60 questions
Jaringan Komputer
Quiz
•
University
60 questions
HTML & CSS
Quiz
•
University
59 questions
ICT_Test
Quiz
•
University
50 questions
Python: Built-In Functions and Upto Tuple
Quiz
•
University
50 questions
Algoritmika 1.
Quiz
•
10th Grade - University
50 questions
CN Quiz-1
Quiz
•
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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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