C Programming: Input and Output

C Programming: Input and Output

University

20 Qs

quiz-placeholder

Similar activities

C-Py QUIZ | ROUND 1

C-Py QUIZ | ROUND 1

University

20 Qs

Final de Programación

Final de Programación

University

25 Qs

Conocimientos básicos de C

Conocimientos básicos de C

University

20 Qs

C Programming Concepts

C Programming Concepts

University

25 Qs

พื้นฐานการเขียนโปรแกรมคอมพิวเตอร์

พื้นฐานการเขียนโปรแกรมคอมพิวเตอร์

10th Grade - University

20 Qs

C++ Quiz

C++ Quiz

University

25 Qs

Programming Homework Questions

Programming Homework Questions

University

17 Qs

Review ETS Coding

Review ETS Coding

University

25 Qs

C Programming: Input and Output

C Programming: Input and Output

Assessment

Quiz

Computers

University

Medium

Created by

Nursyahirah Tarmizi

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'printf' function in C programming?

The purpose of the 'printf' function is to read user input.

The purpose of the 'printf' function is to print formatted output.

The purpose of the 'printf' function is to perform mathematical calculations.

The purpose of the 'printf' function is to create loops in the program.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which header file should be included to use the 'scanf' function in C programming?

string.h

stdio.h

math.h

stdlib.h

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the format specifier for printing an integer in decimal format using 'printf'?

%s

%i

%f

%d

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you read a character from the user using 'scanf'?

scanf('%d', &ch)

scanf('%s', &ch)

scanf('%f', &ch)

scanf("%c", &ch)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'getchar' function in C programming?

To read a single character from the standard input and return its hexadecimal value.

To read a single character from the standard input and return its Unicode value.

To read a single character from the standard input and return its binary value.

To read a single character from the standard input and return its ASCII value.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the format specifier for printing a floating-point number using 'printf'?

%f

%d

%s

%c

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you read a string from the user using 'scanf'?

scanf(str);

scanf("%s", str);

scanf('%s', str);

scanf(str, '%s');

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?