Ok so I've been starting out with some c++. Anywho, I just finished writing a program (what the program does is irrelevant, it's a useless program to everyone else) and there are no errors in it at all, but there are two sections to it (calculator and age input), and it won't go to the second one one (Age input)
Anybody wish to take a crack at it?
45 lines, so not much at all. Most of those lines are brackets and spaces.
Anybody wish to take a crack at it?
45 lines, so not much at all. Most of those lines are brackets and spaces.
#include
#include
using namespace std;
//Two test functions I'm trying out for a functions tutorial. The first one multiplise two numbers
//the second one gets age input from the user. Both completely irrelevent to each other.
int calc (int num1, int num2);
int age (int x);
int main()
{
int num1;
int num2;
cout<<"Please insert two " <<"numbers you wish to be multiplied\n";
cin>>num1 >>num2;
cout<<"The answer is " <<calc (num1, num2) <<"\n";
cin.ignore();
}
int calc (int num1, int num2)
{
return num1 * num2;
}
int age (int x)
{
cout<<"Enter your age";
cin>>x;
if (x < 50 ){
cout<<"Yay";
}
else if (x > 50 ){
cout<<"Nooo";
}
else if ( x == 50 ){
cout<<"Huh?";
}
return x;
}
#include
using namespace std;
//Two test functions I'm trying out for a functions tutorial. The first one multiplise two numbers
//the second one gets age input from the user. Both completely irrelevent to each other.
int calc (int num1, int num2);
int age (int x);
int main()
{
int num1;
int num2;
cout<<"Please insert two " <<"numbers you wish to be multiplied\n";
cin>>num1 >>num2;
cout<<"The answer is " <<calc (num1, num2) <<"\n";
cin.ignore();
}
int calc (int num1, int num2)
{
return num1 * num2;
}
int age (int x)
{
cout<<"Enter your age";
cin>>x;
if (x < 50 ){
cout<<"Yay";
}
else if (x > 50 ){
cout<<"Nooo";
}
else if ( x == 50 ){
cout<<"Huh?";
}
return x;
}