#include<iostream> // it is a library used for display
#include<conio.h> // its is also a library used for input output statement
using namespace std;
main()
{
int age; // age variable with datatype int
long int age_month; /* long is also a datatype but it can hold more bigger data then int
so variable age_month with datatype long */
char name[50]; // char is datatype with variable name name it can only hold character like " naveed"
cout<<"Enter name of person:"<<endl; // will output Comment "enter the name of person
cin>>name; //here is input object through which you can enter the name of person
cout<<"enter the age of person in year:"<<endl; // here its output the comment "enter the age "
cin>> age; // here is the input function which input the age form the user
age_month=age*12; // here the multiplication of age and the month in the year are occure and result is saved in th age_month
cout<<"Name of the person you enterd was:"<<name<<endl; // here is the name the user enterd during the running of program
cout<<"Age in month"<<age_month<<endl; // here is the age in months after the calcultion
}
// Here is your age calculator in month
/* TASK: write a program that take servel input from user like 1) enter name 2) enter the markes obtained in c++
3) enter the markes obtained in java 3) enter the markes obtained in OS
and then find the average of the markes and display name and average */
#include<conio.h> // its is also a library used for input output statement
using namespace std;
main()
{
int age; // age variable with datatype int
long int age_month; /* long is also a datatype but it can hold more bigger data then int
so variable age_month with datatype long */
char name[50]; // char is datatype with variable name name it can only hold character like " naveed"
cout<<"Enter name of person:"<<endl; // will output Comment "enter the name of person
cin>>name; //here is input object through which you can enter the name of person
cout<<"enter the age of person in year:"<<endl; // here its output the comment "enter the age "
cin>> age; // here is the input function which input the age form the user
age_month=age*12; // here the multiplication of age and the month in the year are occure and result is saved in th age_month
cout<<"Name of the person you enterd was:"<<name<<endl; // here is the name the user enterd during the running of program
cout<<"Age in month"<<age_month<<endl; // here is the age in months after the calcultion
}
// Here is your age calculator in month
/* TASK: write a program that take servel input from user like 1) enter name 2) enter the markes obtained in c++
3) enter the markes obtained in java 3) enter the markes obtained in OS
and then find the average of the markes and display name and average */
Comments
Post a Comment