C Programming: Input and Output

C Programming: Input and Output

University

20 Qs

quiz-placeholder

Similar activities

Programming Concepts in C

Programming Concepts in C

University

20 Qs

C/C++ Programming Chapter 2

C/C++ Programming Chapter 2

University

16 Qs

CSE C Section

CSE C Section

University

20 Qs

C programming

C programming

University

15 Qs

Competitive Coding-I

Competitive Coding-I

University

20 Qs

ASK T2 - Kod Arahan (Python)

ASK T2 - Kod Arahan (Python)

7th Grade - University

20 Qs

Programming in C(1)

Programming in C(1)

University

20 Qs

C Programming 2

C Programming 2

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?