I am a noobie c++ programmer and have a Question on how to
complete this program
I want to be able to input a or v and then be able to jump to the area to input and calculate my result and display
I tried goto(i know dont laugh)
and tried bool but it didnt work
someone help me
#include<iostream>
int main()
{
int area, volume, height, width, length;
std::cout<<"\nDo you wish to calculate Area or volume?(A/V)";
char av;
std::cin>>av;
{ //input and calculate area
std::cout<<"\ninput width:";
std::cin>>width;
std::cout<<"\ninput length:";
std::cin>>length;
area=length*width;
std::cout<<"area is:";
std::cout<<area;
}
{ //input and calculate volume
std::cout<<"\ninput width:";
std::cin>>width;
std::cout<<"\ninput height:";
std::cin>>height;
std::cout<<"\ninput length:";
std::cin>>length;
volume=height*width*length;
std::cout<<"\nvolume is:";
std::cout<<volume;
}
return 0;
}