CPP
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
#include<iostream.h>
#include<conio.h>
int calc(int);
int calc(float);
int main()
{
int a;
float b;
clrscr();
cout<<"enter the number ";
cin>>a;
cout<<"\nso the square of "<<a<<" is "<<calc(a)<<endl;
cout<<"\nenter the another number for finding its cube"<<endl;
cin>>b;
cout<<"cube of "<<b<< " is "<<calc(b);
getch();
return 0;
}
int calc(int x)
{
return x*x;
}
int calc(float y)
{
return y*y*y;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run