Creating Calculator Using Functions, use functions to find sum, sub, mul, div in dev c++ learn how to use functions in how to program c++
Creating Calculator Using Functions, use functions to find sum, sub, mul, div in dev c++
learn how to use functions in how to program c++
#include<iostream>
using namespace std;
void add(float, float);
void sub(float, float);
void mul(float, float);
void div(float, float);
int main ()
{
float a, b;
cout<<"Enter two Numbers";
cin>>a>>b;
void add(float, float);
void sub(float, float);
void mul(float, float);
void div(float, float);
cout<<"Program executed successfully and result is given below\n";
{
void add(float a, float b);
float sum=0;
sum=a+b;
float sub=a-b;
float mul;
mul=a*b;
float div;
div=a/b;
cout<<"Sum is ="<<sum<<endl;
cout<<"Sub is ="<<sub<<endl;
cout<<"Mul is ="<<mul<<endl;
cout<<"div is ="<<div<<endl;
}
}
COMMENTS