Chapter 7 Quiz

Chapter 7 Quiz

University

20 Qs

quiz-placeholder

Similar activities

CODEATHON'22

CODEATHON'22

University

20 Qs

SJIT ECE APTITUDE PRACTICE TEST-1@10-11-2023

SJIT ECE APTITUDE PRACTICE TEST-1@10-11-2023

University

20 Qs

Test your knowledge 03

Test your knowledge 03

12th Grade - University

15 Qs

Luyện tập 1

Luyện tập 1

University

20 Qs

HIMSI Webinar Series 4

HIMSI Webinar Series 4

University

15 Qs

Programação em Python Introdução

Programação em Python Introdução

12th Grade - University

20 Qs

Exploring the Basics of C Programming

Exploring the Basics of C Programming

11th Grade - University

20 Qs

Type Conversions and Computation

Type Conversions and Computation

University

20 Qs

Chapter 7 Quiz

Chapter 7 Quiz

Assessment

Quiz

Other

University

Hard

Created by

Amrit Selva Ganesh

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct format specifier for printing an unsigned int?

%ld

%d

%i

%u

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which type conversion is safest to prevent data loss?

Converting float to int

Converting char to int

Converting double to float

Converting int to long

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which format specifier is used to print a long int?

%d

%ld

%f

%hd

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an unsigned int?

short int

int

long int

unsigned int

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is integer overflow?

An arithmetic result is too large to represent

A variable is too large to store in memory

An error in scanf

The program crashes

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to prevent overflow when multiplying two ints?

i = (long)(j * j);

i = j * (long)j;

i = (long) j * j;

i = j * j;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which cast will convert an int to double in division?

(double)dividend / divisor

(float)dividend / divisor

(int)dividend / divisor

(long)dividend / divisor

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?