Menu

Hi Coding Issue Code Terminates Put Age Run Code Basically Writing Code Ask Name Age Perso Q43825226

Hi I have a coding issue, This is my code below but itterminates before I can put in age when I run the code. Basically Iam writing a code where I ask for the name and age of a person thenit is suppose to calculate the age of the person in dog years(dogyear = age * 7) while also outputting the person name, age inthe same line as you can see my attempt in the code

#include <iostream>

using namespace std;

int main(){

int name;

int age;

int dogyear;

cout << “Hiya, what is your name? “;

cin >> name;

cout <<“How old are you? ” ;

cin >> age;

dogyear = age * 7;

cout <<” Hi ” << name << ” you are ” <<age;

cout << “Did you know you are ” << dogyear <<” in dog years!”;

return 0;

}

Expert Answer


Answer to Hi I have a coding issue, This is my code below but it terminates before I can put in age when I run the code. Basically…

OR