I have no clue what to do. I am assigned to make a console app. with 3 ways to
add by 1, and 3 ways to subtract by 1. I tried making my own source code but
since I was not provided an example by my teacher, It does not work as
intended. I was unable to build from anything.
any idea how to make it work?
I am using Dev-C++ from Bloodshed
include <cstdlib>
include <iostream>
using namespace std;
int main(int argc, char *argv)
{ int Num1 = Num1 + 1;
cout <<" enter a variable \n";
cin >> Num1;
cout <<" your number plus 1 is " << Num1=Num1+1 << "";
cout << endl;
int Num2 + = 1;
cout <<"enter another variable \n";
cin >> Num2;
cout <<" your number plus 1 is " << Num2+=1 << "";
cout << endl;
int Num3 ++;
cout <<"enter another variable \n";
cin >> Num3;
cout <<" your number plus 1 is " << Num3++ << "";
cout << endl;
int Num4 = Num1 - 1;
cout <<" enter a variable \n";
cin >> Num4;
cout <<" your number plus 1 is " << Num4=Num4-1 << "";
cout << endl;
int Num5 - = 1;
cout <<"enter another variable \n";
cin >> Num5;
cout <<" your number plus 1 is " << Num5-=1 << "";
cout << endl;
int Num6 --;
cout <<"enter another variable \n";
cin >> Num6;
cout <<" your number plus 1 is " << Num6-- << "";
cout << endl;
system("PAUSE");
return 0;
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
C++ bloodshed obviously
I have no clue what to do. I am assigned to make a console app. with 3 ways to
add by 1, and 3 ways to subtract by 1. I tried making my own source code but
since I was not provided an example by my teacher, It does not work as
intended. I was unable to build from anything.
any idea how to make it work?
I am using Dev-C++ from Bloodshed
include <cstdlib>
include <iostream>
using namespace std;
int main(int argc, char *argv)
{ int Num1 = Num1 + 1;
cout <<" enter a variable \n";
cin >> Num1;
cout <<" your number plus 1 is " << Num1=Num1+1 << "";
cout << endl;
int Num2 + = 1;
cout <<"enter another variable \n";
cin >> Num2;
cout <<" your number plus 1 is " << Num2+=1 << "";
cout << endl;
int Num3 ++;
cout <<"enter another variable \n";
cin >> Num3;
cout <<" your number plus 1 is " << Num3++ << "";
cout << endl;
int Num4 = Num1 - 1;
cout <<" enter a variable \n";
cin >> Num4;
cout <<" your number plus 1 is " << Num4=Num4-1 << "";
cout << endl;
int Num5 - = 1;
cout <<"enter another variable \n";
cin >> Num5;
cout <<" your number plus 1 is " << Num5-=1 << "";
cout << endl;
int Num6 --;
cout <<"enter another variable \n";
cin >> Num6;
cout <<" your number plus 1 is " << Num6-- << "";
cout << endl;
system("PAUSE");
return 0;
}
Never mind I fixed it with an online manual.