#include <iostream>
#include <cmath>
#include <windows.h>
using namespace std;
int A;
int B;
int main ()
{
cout << "how many legs do you have?" << endl; //outputs how many legs do you have
cin >> A; //user inputs what A stands for
cout << "how many arms do you have?" << endl;
cin >> B; //user inputs what B stands for
if (A < 2) //saying if A is smaller than 2 do this if it isnt skip this
{ //start of what to do
cout << "your legs are a cripple" << endl;
} // end of what to do
if (A > 2) // saying if A is larger than 2 do this, if not skip it
{ //start of what to do
cout << "your legs are MUTANT!" << endl;
} // end of what to do
if (A == 2) // saying if A is equal to 2 do this, if not skip it
{ //start of what to do
cout << "your legs are normal" << endl;
} //end of what to do
Sleep (2000); //pauses the program for 200 milliseconds
if (B < 2) //saying is B is smaller than 2 say this, if not skip it
{
cout << "your arms are a cripple" << endl;
}
if (B > 2) // if b is larger than 2 do this, if not skip it
{
cout << "your arms are MUTANT!" << endl;
}
if (B == 2) //saying if b is equal to 2 do this, if not skip it
{
cout << "your arms are normal" << endl;
}
system ("pause");// makes the press any key to continue
return 0; // returns to the value 0
}
#include <iostream>
#include <cmath>
#include <windows.h>
#include <stdio.h>
#include <conio.h>
int main ()
{
using namespace std;
system ("pause");
system ("cls");
cout << "welcome to your first C++ tutorial, this will teach you some basics of C++ " << endl;
cout << "this lesson is the basics and outputtting" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "NOTE IN THIS TUTORIAL '' means speach marks (the same thing just " << endl;
cout << "closer together) usually found on top of your single quote mark on the keyboard" << endl;
system ("pause");
system ("cls");
cout << "If you havent got it already you need to download a program called Dev C++" << endl;
cout << "Then select file >> new >> source file" << endl;
cout << " " << endl;
cout << "first you are going to have to enter " << endl;
cout << "#include <iostream>" << endl;
cout << "#include <cmath>" << endl;
cout << " " << endl;
system ("pause");
system ("cls");
cout << "#include <iostream> lets you output and input data " << endl;
cout << "#include <cmath> lets you calculate" << endl;
cout << "next you will need to start the main program of the function, " << endl;
cout << "you can do this by entering" << endl;
cout << "int main ()" << endl;
cout << "{" << endl;
cout << "" << endl;
cout << "}" << endl;
system ("pause");
system ("cls");
cout << "inside the parenticies (curly brackets) put" << endl;
cout << "the main body of your coding, in this tutorial" << endl;
cout << "we will enter" << endl;
system ("pause");
system ("cls");
cout << "using namespace std;" << endl;
cout << "cout << ''this is my first c++ tutorial'' << endl; " << endl;
cout << " cout << ''this is the first thing i have written'' << endl; " << endl;
system ("pause");
system ("cls");
cout << "now down the bottom put" << endl;
cout << "" << endl;
cout << "system (''pause'');" << endl;
cout << "return 0;" << endl;
cout << "now close the curly braces" << endl;
cout << "press F9 to compile and run this or select, execute >> compile & run" << endl;
cout << "so, what you have so far should look like this.." << endl;
system ("pause");
system ("cls");
cout << "#include <iostream>" << endl;
cout << "#include <cmath>" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "int main ()" << endl;
cout << "{" << endl;
cout << "using iostream std;" << endl;
cout << " cout << ''this is my first c++ tutorial'' << endl;" << endl;
cout << " cout << ''this is the first thing i have written'' << endl;" << endl;
cout << "" << endl;
cout << "system (''pause''); " << endl;
cout << "return 0;" << endl;
cout << "}" << endl;
cout << "" << endl;
system ("pause");
system ("cls");
cout << "now lets look over this code" << endl;
cout << "" << endl;
cout << "#include <iostream> is letting output the program onto the screen" << endl;
cout << "#include <cmath> was unused but lets us do maths sums and calculate" << endl;
cout << "int main () was start the main function an intiger function" << endl;
cout << "cout << ''text'' << endl can be broken up into 3 pieces" << endl;
cout << "cout outputs onto the screen" << endl;
cout << "whatever is between the quotation marks is outputted" << endl;
cout << "endl is ending the line" << endl;
system ("pause");
system ("cls");
cout << "now lets involve cmath" << endl;
cout << "under the cout << this is the first thing...." << endl;
cout << "write-" << endl;
cout << "cout << 9 + 1 - 2 * 7 << endl;" << endl;
cout << "this is 9 plus 1 minus 2 times 7" << endl;
cout << "" << endl;
system ("pause");
system ("cls");
cout << "so in the end it looks like:" << endl;
system ("cls");
cout << "#include <iostream>" << endl;
cout << "#include <cmath>" << endl;
cout << "int main ()" << endl;
cout << "{" << endl;
cout << "using namespace std;" << endl;
cout << "cout << '' this is my first c++ tutorial'' << endl;" << endl;
cout << "cout << ''this is the first thing i have written'' << endl;" << endl;
cout << "9 + 1 - 2 * 7" << endl;
cout << "" << endl;
cout << "system (''pause'');" << endl;
cout << "return 0" << endl;
cout << "}" << endl;
system ("pause");
system ("cls");
cout << "There are a few things you are going to have to remember" << endl;
cout << "an intiger takes up 4 bytes" << endl;
cout << "" << endl;
cout << "You need to finish all commands with a ; (semi colon)" << endl;
cout << "" << endl;
cout << "you do not necessarily need to end line after your couts" << endl;
cout << "" << endl;
cout << "Next tutorial we will work on inputting and intigers" << endl;
system ("pause");
system ("cls");
cout << "AND THE MOST IMORTANT THING!" << endl;
system ("pause");
system ("pause");
return 0;
}
