Questions:
Write a program that asks the user to enter his or her age.The program then should display the age in months:
Enter your age: 29
Yo u r a g e i n mo n t h s i s 3 8 4 .
Explanation:
This problem is simple and just demonstration of basic console out operation. Below mention code is compiled in Visual Studio 2015 and output snap is attached.. If any problem you feel and want explanation feel free to contact.
Code:
Output:
Related Articles:
Write a program that asks the user to enter his or her age.The program then should display the age in months:
Enter your age: 29
Yo u r a g e i n mo n t h s i s 3 8 4 .
Explanation:
This problem is simple and just demonstration of basic console out operation. Below mention code is compiled in Visual Studio 2015 and output snap is attached.. If any problem you feel and want explanation feel free to contact.
Code:
/**************************************************|
/*************C++ Programs And
Projects************|
***************************************************/
#include<iostream>
using namespace std;
void main() {
int age;
cout
<< "Enter your Age ==
";
cin
>> age;
cout
<< "Your age
in months is = " << age * 12<<endl;
}
Output:
Related Articles:
0 Questions:
Post a Comment