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.
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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.