
Mastering C Programming Concepts

Quiz
•
Computers
•
University
•
Medium
Pushpendra Pateriya
Used 1+ times
FREE Resource
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;'
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Linked List

Quiz
•
University
20 questions
Arquitectura de computadoras I

Quiz
•
University
16 questions
Linked List and Arrays in JAVA

Quiz
•
University
16 questions
DS - Linked List - S1

Quiz
•
University
15 questions
C Programming Array Concepts

Quiz
•
University
20 questions
Application Software - Revision Quiz

Quiz
•
University
20 questions
NVIBES Tech Quiz Round 1

Quiz
•
University
15 questions
Exercise 008

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