Search Header Logo

Session 4 : Multiple Choice

Authored by Jirapod Jintasornrom

Computers

University

Used 1+ times

Session 4 : Multiple Choice
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

2 mins • 1 pt

What is the purpose of scanf in C?

To print output to the console

To read input from the console

To allocate memory

To perform mathematical operations

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Which of the following is the correct way to use scanf to read an integer value into variable x?

scanf("%d", x);

scanf("%d", &x);

scanf("d%", x);

scanf("d%", &x);

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the purpose of printf in C?

To read input from the console

To print output to the console

To allocate memory

To perform mathematical operations

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

How can you read a character input using scanf in C?

scanf("%c", &ch);

scanf("%s", ch);

scanf("%d", ch);

scanf("%c", ch);

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the correct format specifier to read a float value using scanf in C?

%f

%d

%s

%c

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What will be the output of the following code if the user enters 12 34?

int main( )

{ int a, b;

scanf("%d %d", &a, &b);

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

return 0; }

12 34

34 12

12 12

34 34

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the purpose of using the & operator in scanf function in C?

To read input from the console

To print output to the console

To perform mathematical operations

To allocate memory

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?