How can i write a program to input two numbers and substraction them ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i write a program to input two numbers and substraction them ?

29th Dec 2016, 10:53 PM
khalid okail
khalid okail - avatar
3 Answers
+ 2
Please take a look at this code: https://code.sololearn.com/cWx409HpnDG3/?ref=app
29th Dec 2016, 11:19 PM
Michael Isac Girardi
Michael Isac Girardi - avatar
+ 1
Following program takes two numbers as input from the user and performs subtraction. #include <iostream> using namespace std; int main() { int a,b; cout<<"Enter first number : "; cin>>a; cout<<"\nEnter second number : "; cin>>b; int result = a-b; cout<<"\n\nSubraction Result = "<<result; return 0; }
29th Dec 2016, 11:36 PM
Yousaf
Yousaf - avatar
0
I'm not an expert... Pseudo code \/ str(int) x = "" y = "" say("","Give a number") return as x say("",""Give another!") return as y x - y = z say(z) end :) The above crap-code will NOT Work, it was just an example for you to base-off-of.
29th Dec 2016, 11:06 PM
ghostwalker13
ghostwalker13 - avatar