Session 4 : Multiple Choice

Session 4 : Multiple Choice

University

10 Qs

quiz-placeholder

Similar activities

Sintaxis en C

Sintaxis en C

University

15 Qs

csharp

csharp

University

10 Qs

Quiz - Control Structure in C programming

Quiz - Control Structure in C programming

University

15 Qs

Coding 1 U7

Coding 1 U7

9th Grade - University

15 Qs

На сколько ты знаешь C#

На сколько ты знаешь C#

University

10 Qs

CIS1101-programming practice2

CIS1101-programming practice2

University

10 Qs

JS: Conditionals!

JS: Conditionals!

6th Grade - University

11 Qs

Quiz 1 - Intro to C

Quiz 1 - Intro to C

University

10 Qs

Session 4 : Multiple Choice

Session 4 : Multiple Choice

Assessment

Quiz

Computers

University

Hard

Created by

Jirapod Jintasornrom

Used 1+ times

FREE Resource

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

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?