A simple program is given by Bjarne Stroustrup (developer of C++) to check your compiler: #include [[Image:Create a Simple Program in C++ Step 1 Version 3.
jpg|center]] #include using namespace std; int main () { string s; cout « “Your Name \n”; cin » s; cout « “Hello, " « s « ‘\n’ ; return 0; } A program for finding the sum of two numbers: [[Image:Create a Simple Program in C++ Step 2 Version 3.
jpg|center]] #include using namespace std; int main () { int no1, no2, sum; cout « “\nEnter the first number = " ; cin » no1 ; cout « “\nEnter the second number = " ; cin » no2 ; sum = no1 + no2 ; cout « “\nThe sum of “« no1 «” and “« no2 «” = “« sum «’\n’ ; return 0 ; } A program for finding the product in multiplication problems: [[Image:Create a Simple Program in C++ Step 3 Version 3.
jpg|center]] #include int main() { int v1, v2, range; std::cout «“Please input two numbers:"« std::endl; std::cin » v1 » v2; if (v1 <= v2) { range = v2 - v1; } else { range = v1 - v2; } std::cout « “range = " « range « std::endl; return 0; } A program for finding the value of exponents: [[Image:Create a Simple Program in C++ Step 4 Version 3.
jpg|center]] #include using namespace std; int main() { int value, pow, result=1; cout « “Please enter operand:” « endl; cin » value; #cout « “Please enter exponent:” « endl; cin » pow; for (int cnt=0; cnt!=pow; cnt++) result*=value; cout « value « " to the power of " « pow « " is: " « result « endl; return 0; }
Hint: It should say Save as Type: {select “All Files”}