Unit 3 I/O functions

Quiz
•
Computers
•
University
•
Medium
Abhishek Pandey
Used 1+ times
FREE Resource
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to input an integer using scanf?
scanf("%s", &num);
scanf("%f", &num);
scanf("%d", &num);
scanf("%c", &num);
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct format specifier to print a string in C using printf?
%d
%o
%c
%s
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the scanf function, why is the address-of operator (&) used?
To specify the type of input
To store the input in a variable
To pass the variable's memory address
To terminate the input
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to print a floating-point number with 2 decimal places in C?
printf("%.2f", num);
printf("%2f", num);
printf("%f.2", num);
printf("%2f", num);
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following format specifiers can be used to print an integer value in hexadecimal format?
%o
%i
%x
%d
Similar Resources on Wayground
8 questions
Unit 3 C Pro P1

Quiz
•
University
10 questions
Basics of C

Quiz
•
University
10 questions
T02: Python - The Basics

Quiz
•
University
10 questions
C Programming Lab Quiz

Quiz
•
University
10 questions
CIS1101-programming practice2

Quiz
•
University
10 questions
Session 4 : Multiple Choice

Quiz
•
University
10 questions
c basic

Quiz
•
University
10 questions
JAVA I/O

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade