Search Header Logo

c-prog quiz

Authored by Selvauma C

Computers

Professional Development

Used 1+ times

c-prog quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

1. Which of the following is the correct syntax to include a header file in a C program?

#include<file>

#include file

include<file>

#include "file"

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include<stdio.h>

int main()

{

int x = 10,

y = 20;

printf("%d", x * y);

return 0;

}

10

20

200

Compilation error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the return 0; statement in the main() function?

It stops the execution of the program.

It returns control to the operating system.

It specifies that the program executed successfully.

It prints 0 on the screen.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to access the value of a variable through a pointer?

*

+

%

()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid keyword in C?

return

goto

class

switch

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include<stdio.h>

int main() {

int a = 5, b = 2;

printf("%d", a / b);

return 0;

}

2

3

2.5

0

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write a single-line comment in C?

/* Comment */

// Comment

-- Comment

# Comment

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?