-
Notifications
You must be signed in to change notification settings - Fork 8
/
tut1.cpp
45 lines (44 loc) · 1.11 KB
/
tut1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<iostream.h>
inline int add(int a, int b)
{
return a+b;
}
inline double division(double x, double y)
{
return x/y;
}
inline float difference(float a, float b)
{
return a-b;
}
inline int modulus(int x, int y)
{
return x%y;
}
inline long int multiplication(long int a, long int b)
{
return a*b;
}
int main()
{
int a,b;
double x,y;
float i,j;
long int e,f;
cout<<"\nEnter 2 integer values for calculating there sum:\n";
cin>>a>>b;
cout<<"\nSum of "<<a<<"and "<<b<<" = "<<add(a,b)<<"\n";
cout<<"\nEnter 2 double values for performing division:\n";
cin>>x>>y;
cout<<"\nValue of "<<x<<" divided by "<<y<<" = "<<division(x,y)<<"\n";
cout<<"\nEnter 2 float values for calculating there difference :\n";
cin>>i>>j;
cout<<"\nDifference between "<<i<<" and "<<j<<" = "<<difference(i,j)<<"\n";
cout<<"Enter 2 integer values for calculating there modulus:\n";
cin>>a>>b;
cout<<"\n"<<a<<" modulus "<<b<<" = "<<modulus(a,b)<<"\n";
cout<<"\nEnter 2 long integer values for calculating there product:\n";
cin>>e>>f;
cout<<"\nProduct of "<<e<<" and "<<f<<" = "<<multiplication(e,f)<<"\n";
return 0;
}