C++ program to add two numbers.

you can also use this program to add numbers having decimal point.

c++ code is given below-


#include<iostream.h>

#include<conio.h>

void main()
{
  clrscr();
      float a,b,c;

       cout<<"\n enter a=";

       cin>>a;

       cout<<"\n enter b=";

       cin>>b;

       c=a+b;

       cout<<"\n addition="<<c;

       getch();
    
 }

OUTPUT

 enter a=5

 enter b=7

 addition=12


similar posts-






Comments :

Post a Comment