Search Header Logo

C Programming Quiz

Authored by Zemmary Batucan

Information Technology (IT)

University

Used 6+ times

C Programming Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to declare an integer variable in C?

int var;

integer var;

var int;

int_var;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the #include preprocessor directive do in C?

It includes the standard I/O library

It defines standard input-output functions

It starts the main function

It declares variables

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid comment in C?

// This is a comment

/* This is a comment */

Both a and c

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C, the main() function:

Must always return an integer

It is optional

Can return any data type

Is executed at the end of the program

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly declares a constant in C?

#define PI 3.14

const PI = 3.14

constant PI = 3.14

Both a) and b)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The correct syntax to print "Hello, World!" in C is:

printf("Hello, World!");

print("Hello, World!");

cout << "Hello, World!";

echo "Hello, World!";

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which header file must be included to use the printf() and scanf() functions?

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?