Basic C Programming Quiz Chapter 2

Basic C Programming Quiz Chapter 2

12th Grade

10 Qs

quiz-placeholder

Similar activities

Asas Kelestarian - Set 3

Asas Kelestarian - Set 3

11th - 12th Grade

15 Qs

SIMAK UI SOSIOLOGI KKI 2016

SIMAK UI SOSIOLOGI KKI 2016

12th Grade

15 Qs

Ulangan Harian #1 Mikrokontroller

Ulangan Harian #1 Mikrokontroller

12th Grade

11 Qs

MTA: 98-367 Security Part 3

MTA: 98-367 Security Part 3

KG - Professional Development

15 Qs

programming base

programming base

1st Grade - University

15 Qs

Elements of poetry terms

Elements of poetry terms

1st Grade - University

14 Qs

Koding Paud

Koding Paud

6th Grade - University

10 Qs

Retail Course 1 Unit 2

Retail Course 1 Unit 2

9th - 12th Grade

10 Qs

Basic C Programming Quiz Chapter 2

Basic C Programming Quiz Chapter 2

Assessment

Quiz

Education

12th Grade

Hard

Created by

Hafizul Hasmie

Used 5+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'if' statement in C programming?

To print output to the console

To create a loop structure

To enable a user to specify the order of instructions

To make a decision based on a condition

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to differentiate between the 'if' and 'else' statements in C?

otherwise if

else

otherwise

then

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for the 'do..while' statement in C?

do { statements; } while (condition);

do { statements; } while;

while (condition) { statements; }

do (condition) { statements; } while;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is the 'switch' statement different from the 'if-else' statement in C?

Switch statement is used for loops, while if-else is for decisions

If-else statement can have multiple conditions, while switch has only one

Switch statement is more efficient for multiple conditions, while if-else is for single conditions

If-else statement is used for loops, while switch is for decisions

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'for' statement in C programming?

To create a loop structure

To make a decision based on a condition

To enable a user to specify the order of instructions

To print output to the console

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to compare two values in the 'if' statement in C?

==

!=

<=

>=

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'default' clause in a 'switch' statement in C?

It is used to define the starting value of a loop

It breaks out of the switch statement

It is executed if none of the cases are met

It specifies the default value for a variable

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?