I. What is printed by the following program?
#include<iostream>
#include<string>
using namespace std;
int main()
{
int check1,check2,check3;
int x,y,z;
float number1,number2,number3;
cin>>check1;
check2 = check1 + 1;
check3 = check1 + 2;
cout<<"The three check numbers are:"<<check1<<check2<<check3;
cout<<endl;
cout<<"Enter the dollar amount of check1: ";
cin>>number1;
cout<<"Enter the dollar amount of check2: ";
cin>>number2;
cout<<"Enter the dollar amount of check3: ";
cin>>number3;
cout<<"Total amt withdrawn:"<<number1+number2+number3<<endl;
cout<<"Thank you for banking with us.";
return 0;
}
II. What is printed by the following program segment?
int x,y,z;
x=4;
z=-6;
y=26;
cout<<z/x<<endl;
cout<<static_cast<float>(z)/x<<endl;
cout<<x+y*z<<endl;
cout<<(x+y)*x+y<<endl;
cout<<y%z<<endl;
cout<<y%x<<endl;
III.Complete the following program:
//This program receives input of three numbers and
//computes the average by summing the three numbers
//and dividing the sum by 3.
#include<iostream>
int main()
{
//declarations
//input the three numbers
cin>>num1;
//compute the average
//print out the average
cout<<"The average is: "<<average_3;
return 0;
}