Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double pi = 3.1415;
- void printa(double r);
- int main()
- {
- double r, p;
- cout<< "Enter the radius: ";
- cin>> r;
- cout<< "Enter the value of pi: ";
- cin>> p;
- cout<< "The area calculated in main: "<< (p*r*r)<<endl;
- cout<< "The area calculatd in function: ";
- printa( r);
- return 0;
- }
- void printa(double r){
- cout<< pi*r*r;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement