Search Header Logo

Chapter 7 Quiz

Authored by Amrit Selva Ganesh

Other

University

Chapter 7 Quiz
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 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

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?