How to write a program to subtract two numbers in C++ language
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int a,b,c;
cout <<"Enter two numbers to subtract\n";
cin >> a >> b;
c=a+b;
cout <<"Subtraction of the numbers = " << c << end1;
getch();
}
OUTPUT: -
Enter two numbers to subtract
8
5
Subtraction of the numbers = 3
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int a,b,c;
cout <<"Enter two numbers to subtract\n";
cin >> a >> b;
c=a+b;
cout <<"Subtraction of the numbers = " << c << end1;
getch();
}
OUTPUT: -
Enter two numbers to subtract
8
5
Subtraction of the numbers = 3


No comments:
Post a Comment