Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This code has to be in c++ language. runs and 27.(12 pts) Write a complete progr

ID: 3888382 • Letter: T

Question


This code has to be in c++ language.

runs and 27.(12 pts) Write a complete program (turn an empty file into a program that c ete program (turn an empty file into a program that compiles, performs the task mentioned.) that performs the following Prompt the user for two integer values and read them into integer variables Multiply Output the first integer in a field width of 10 left justified the two integers together and store the result in a third integer variable . Output the second integer in a field width of 10 right justified. . Output the result of the multiplication in a field width of 20 left justified Do not forget the necessary header files and all variable declarations

Explanation / Answer

#include<iostream>

//header file for formatting output fields

#include<iomanip>

using namespace std;

int main()

{

int a, b, c;

cout << "Enter first integer: ";

cin>>a;

cout << "Enter second integer: ";

cin>>b;

//save product of a and b into c

c = a * b;

cout << "#################Output######################" << endl;

//now output the values with specification given in assignment

//output first integer a with fild width 10 left justified

cout << setw(10) << left << a << endl;

//output second integer b with fild width 10 right justified

cout << setw(10) << right << b << endl;

//output result c with fild width 20 left justified

cout << setw(20) << left << c << endl;

}

-------------------------------------------------------------------------

//output

Enter first integer: 78658
Enter second integer: 456
#################Output######################
78658
456
35868048

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote