Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ACTIVITY 1 What is the output of the following code snippet? C++ cout < < setfill('5'); int num = 6; cout < < num; num

ACTIVITY 1

What is the output of the following code snippet? C++

cout << setfill('5');

int num = 6;

cout << num;

num *= 3;

cout << setw(4) << num;

char c = 'B';

int a = 47;

short s = 3;

c++;

cout << setfill('1');

cout << setw(s) << a << right << setw(--s) << c << endl;

cout << setfill('5');

int num = 6;

cout << num;

num *= 87;

num -= 4;

cout << setw(4) << num;

Which of the following inputs will output 5 for the following code?

int a;

float f;

cin >> a >> f;

a += f;

cout << a << endl;

Answer choices:

3 2.5

5.5

2 2.9

6-.5

8-3.4

1 2.5 2

Which of the following inputs will output 7 for the following code? (Note: 'A' = 65 and '0'=48) (select all that apply)

char c;

int a;

cin >> c >> a;

a -= (c-'0');

cout << a << endl;

Answer choices:

55

414.4

21

310

919

Which of the following inputs will output 10 for the following code? (Note: 'A' = 65 and '0'=48)

char c;

int a;

float f;

cin >> c >> a >> f;

a += f * 2;

c -= 60;

a -= c;

cout << a << endl;

Answer choices:

C16.8

F-11 5.5

A 5 5

T33.5

63.5

What was input to output 6255562 to the screen with the following code:

cout << setfill('5') << right;

int num;

cin >> num;

cout << num;

cout << setw(5) << num;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions