#WSQ01

This is a C++ program that ask the user for two numbers and the program print the sum, difference, product, integer based division and the remainder of integer division of the two numbers.

This is my program:

#include
using namespace std;

int main(){
int a,b;
cout<<“Enter Number 1: “; cin>>a;
cout<<“Enter Number 2: “; cin>>b;

cout<<“a + b = “<< a+b<<endl;
cout<<“a – b = “<< a-b<<endl;
cout<<“a * b = “<< a*b<<endl;
cout<<“a / b = “<< a/b<<endl;
cout<<“a % b = “<< a%b<<endl;

return 0;
}

 

Mastery Topics:

  1. Basic types and their use
  2. Basic output
  3. Basic user input

Leave a comment