Write a cpp program to substract two numbers taking input form user?

#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 int a, b;
 cout<<"Enter first number: ";
 cin>>a;
 cout<<"Enter second number: ";
 cin>>b;
 cout<<"Substraction of two numbers is: "<<a-b;
 getch();
}

Ourput:



/* For IDK Code Block */

#include<iostream>
#include<conio.h>
using namespace std;
main()
{
 int a, b;
 cout<<"Enter first number: ";
 cin>>a;
 cout<<"Enter second number: ";
 cin>>b;
 cout<<"Substraction of two numbers is: "<<a-b;
 getch();
}

Output:









Note:-

 In Code Block or some other idk clrscr() function gives error: 'clrscr' was not declared in this scope.

Comments

Popular posts from this blog

Larch Soft Pvt. Ltd. - Best Website & Hosting Provider