Search Header Logo

C Programming: Input and Output

Authored by Nursyahirah Tarmizi

Computers

University

Used 1+ times

C Programming: Input and Output
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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');

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?