Create a program that will ask for two float numbers and print its sum, difference, product, quotient and its remainder.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float num1,num2;
cout<<"Enter the first number:";
cin>>num1;
cout<<"Enter the second number:";
cin>>num2;
cout<<"The sum is:"<<num1+num2<<endl;
cout<<"The differnce is:"<<num1-num2<<endl;
cout<<"the product is:"<<num1*num2<<endl;
cout<<"The quotient is:"<<num1/num2<<endl;
cout<<"The remainder is:"<<remainder(num1, num2)<<endl;
return 0;
}
Comments
Leave a comment