Skip to content

Instantly share code, notes, and snippets.

@hnxsad
Created June 8, 2024 08:43
Show Gist options
  • Select an option

  • Save hnxsad/7b747490d6da072b04688246ac7b2be0 to your computer and use it in GitHub Desktop.

Select an option

Save hnxsad/7b747490d6da072b04688246ac7b2be0 to your computer and use it in GitHub Desktop.
//Write a C++ program to add, subtract, multiply, and divide two numbers1.
#include <iostream>
int main() {
int fitstNumber=0, secondNumber=0;
std::cout << "---------------------------------\n";
std::cout << "enter the two numbers\n";
std::cin>>fitstNumber>>secondNumber;
std::cout << "---------------------------------\n";
std::cout << "Addition "<<fitstNumber+secondNumber;
std::cout << "\n---------------------------------\n";
std::cout << "Subtraction "<<fitstNumber-secondNumber;
std::cout << "\n---------------------------------\n";
std::cout << "Multiplication "<<fitstNumber*secondNumber;
std::cout << "\n---------------------------------\n";
std::cout << "Division "<<fitstNumber/secondNumber;
std::cout << "\n---------------------------------\n";
std::cout << "Remainder "<<fitstNumber%secondNumber;
std::cout << "\n---------------------------------";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment