What exactly is outputted by the following program Suppose t


What exactly is outputted by the following program? Suppose the input is 15 20. #include using namespace std const inf NUM = 12; const double x = 110.5; int main (int argc, argv[]) {int a, b; double z; char grade = \'B\'; B = 25; cout

Solution

Solution.cpp


#include <iostream>//header file for input output function
#include <iomanip>//header file for set precision      // std::setprecision
using namespace std;//it tells the compiler to link std namespace
const int NUM=12;//const variables
const double x=110.5;
int main(int argc,char *argv[])
{//main function
    int a,b;//variable declaration
    double z;
    char grade=\'B\';
    a=25;
    cout<<fixed<<showpoint;
    cout<<setprecision(1);
    cout<<\"a = \"<<a<<endl;
    cout<<\"Enter two integers \";
    cin>>a>>b;//key board inputting
    cout<<endl;
    cout<<\"the numbers you entered are \"<<a<<\"and \"<<b<<endl;
    z=x+2*a%3-b;
    cout<<\"z = \"<<z<<endl;
    cout<<\"you grade is \"<<grade<<endl;
    a=2*NUM+z;
    cout<<\"the value of a is \"<<a<<endl;  
return 0;
}


output

a = 25                                                                                                                                                                   

Enter two integers 15 20                                                                                                                                                 

                                                                                                                                                                         

the numbers you entered are 15and  20                                                                                                                                    

z = 90.5                                                                                                                                                                 

you grade is B                                                                                                                                                           

the value of a is  114

 What exactly is outputted by the following program? Suppose the input is 15 20. #include using namespace std const inf NUM = 12; const double x = 110.5; int ma

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site