How to write a program that defines an integer variable named age and a float variable named weight. Store your age and weight as literals in the variables. The program should display these values on the screen in a manner similar to the following:
Program Output
My age is 26 and my weight is 180 pounds.
#include <iostream>
usingnamespace std;
int main()
{
int age;
float weight;
cout<<"Please enter your age: \n";
cin>>age;
cout<<"Please enter your Weight: \n";
cin>>weight;
cout<<"My age is " <<age<< " and my weight is " <<weight<<endl;
return 0;
}
or
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
usingnamespace std;
int main()
{
int age = 26;
float weight = 180;
cout<<"My age is " <<age<< " and my weight is " <<weight<<endl;
return 0;
}
note: In the future, make sure to provide your own attempt, and read the rules.