Answer to Question #31330 in C++ for Rajsegara

Question #31330
Prompt for and receive your age in years and months and calculate and display your age in months. If the calculated months figure is more than 500, three asterisks should also appear beside the month figure
1
Expert's answer
2013-05-30T06:14:10-0400
#include <iostream>

using namespace std;

int main()
{
cout << "enter& your age in years and months" << endl;
int a,b,n,sum;
cout << "enter& your age in years " << endl;
cin>>a;
cout << "and enter& your age in& months" << endl;
cin>>b;

n=a*12;
sum=n+b;
& cout << "sum age in& months = " <<sum;
& if(sum>500){cout<<"***"<<endl;}

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS