
Mastering C Programming Concepts
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Pushpendra Pateriya
Used 1+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for a basic for loop in C?
for(initialization: condition: increment) { // code }
for(initialization; increment; condition) { // code }
for(initialization; condition; increment) { // code }
for(condition; initialization; increment) { // code }
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Write a simple while loop that prints numbers from 1 to 5.
i = 1 while i <= 5: print(i) i += 1
for i in range(1, 6): print(i)
i = 0 while i < 5: print(i) i += 1
i = 1 while i < 5: print(i) i += 1
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you use an if-else statement to check if a number is positive or negative?
Use an if-else statement to compare the number to zero.
Use a loop to iterate through the number.
Check if the number is greater than one.
Use a switch statement to check the number.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the purpose of nested if conditions with an example.
To determine if a student should retake the exam based on their attendance.
For example, in a grading system, if a student's score is above 60 (outer if), then check if the score is above 80 (inner if) to determine if they receive a distinction.
To check if a student's score is below 50 for a passing grade.
To calculate the average score of all students in the class.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax of a switch case statement in C?
switch(expression) { case constant1: // statements; case constant2: // statements; }
switch { case constant1: // statements break; case constant2: // statements break; }
switch(expression) { case constant1: // statements break; case constant2: // statements break; default: // statements }
switch(expression) { case constant1: // statements; default: // statements; }
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you use pointers to access members of a structure?
Use the dot operator (.) with a pointer to access structure members.
Access structure members directly without using pointers.
Use the asterisk operator (*) to dereference and access structure members.
Use the arrow operator (->) with a pointer to access structure members.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a pointer in C and how is it declared?
A pointer in C is declared with 'pointerName : type;'
A pointer in C is a variable that holds a string value.
A pointer in C is declared using the syntax 'type *pointerName;', for example, 'int *ptr;'
A pointer in C is declared using 'type pointerName;'
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
15 questions
Monday Week#2
Quiz
•
University
18 questions
Conocimientos sobre Adobe Photoshop
Quiz
•
8th Grade - University
16 questions
Gerência do Processador
Quiz
•
University
20 questions
Computación 1ro y 2do básico
Quiz
•
1st Grade - University
15 questions
IT 209
Quiz
•
University
20 questions
PHP First Internal Practical Viva
Quiz
•
University
15 questions
Assessment 08
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
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
20 questions
Figurative Language Review
Quiz
•
6th Grade
