Skip to main content

Posts

Featured

HOW TO CREATE A CALCULATOR

2 Declare Headers.  Begin writing in source file, using #include declare headers iostream and iomanip and using the identifier, using namespace declare std;. #include <iostream> #include <iomanip> using namespace std ; 3 Create main.  Create the main statement you are going to write the code in. Add the return statement at end of code in the main function. int main ( ) { return 0 ; } 4 Create variables.  Begin code between brackets of the main statement before the return statement. Declare int variables num1 and num2, and char variable opr. int num1, num2 ; char opr ; 5 Get values for num1 and num2.  Use the cout command to prompt the user to enter two numbers. Using cin Assign the input to variables num1 and num2. cout << "Enter two integers: " ; cin >> num1 >> num2 ; 6 Get operator for opr.  Use the cout command to prompt use...

Latest Posts

HOW TO LEARN ENGLISH