Write a program in C++ to find Addition, Subtraction, Multiplication, Division, Remainder and Average of two floating numbers
#include <iostream.h> #include <conio.h> int main() { float a, b; cout << "First No: "; cin >> a; cout << "Second No: "; cin >> b; cout << "Add:" << a+b << endl; cout << "Sub:" << a-b << endl; cout << "Div:" << a/b << endl; cout << "Mul:" << a*b << endl; cout << "Remainder:" << (int)a % (int)b << endl; cout << "Average:" << (a+b)/2 << endl; getch(); return 0; }
Output: