-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSurfArea.c
More file actions
43 lines (26 loc) · 791 Bytes
/
SurfArea.c
File metadata and controls
43 lines (26 loc) · 791 Bytes
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
// VIA This code One Can Find Surface Area Of A Cylander Having a radius & height..
#include <stdio.h>
#include <math.h>
// Here we are defining pi to be have value 3.14
#define PI 3.14
// Making a function to print area of cylander..
float area(float a, float b)
{
return (2 * a * b * PI);
}
int main()
{
float radius, height;
// getting radius and height as input from user..
printf("enter radius :");
scanf("%f", &radius);
printf("\n");
printf("enter height :");
scanf("%f", &height);
printf("\n");
// calling out the function we made in starting..
float Area = area(radius, height);
// Now let code do it's work and give us surface area of cylander as output to our code..
printf("area is :%f", Area);
return 0;
}