Tuesday, 29 September 2015

Write a CPP Program To Perform Addition,Subtraction,Multiliation And Division using Float Data type

1:  #include<iostream.h>  
2:  #include<conio.h>  
3:  #include<stdio.h>  
4:  void main()  
5:  {  
6:    float a,b;  
7:    cout << "Enter 2 numbers" << endl;  
8:    cin >> a>>b;  
9:    int sum=a+b;  
10:    int diff=a-b;  
11:    int mul=a*b;  
12:    float div=a/b;  
13:    cout << "Sum = " << sum <<endl;  
14:    cout << "Difference = " << diff <<endl;  
15:    cout << "Multiplication = " << mul <<endl;  
16:    cout << "Division = " << div <<endl;  
17:       getch();  
18:  }  

No comments:

Post a Comment