Advertisement
Niloy007

Siam Problem 2 Fixed

Apr 17th, 2021
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void calArea(double *radius) {
  4.     double x = (*radius);
  5.     double area = (3.1416 * x * x);
  6.     double perimeter = (2 * 3.1416 * x);
  7.     printf("Area = %.2lf\n", area);
  8.     printf("Perimeter = %.2lf\n", perimeter);
  9. }
  10.  
  11. int main() {
  12.     double radius;
  13.     printf("Enter the radius of the circle\n");
  14.     scanf("%lf", &radius);
  15.     calArea(&radius);
  16. }
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement