From 9aca1c62fb8276604f906a089b540ba09d339b70 Mon Sep 17 00:00:00 2001 From: Bibek1985 <71976396+Bibek1985@users.noreply.github.com> Date: Wed, 30 Sep 2020 23:39:33 +0530 Subject: [PATCH 1/2] Update cylinder.c --- c/cylinder.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/c/cylinder.c b/c/cylinder.c index 55bda34..8d6d412 100644 --- a/c/cylinder.c +++ b/c/cylinder.c @@ -3,7 +3,6 @@ */ #include -#define PI 22/7 //function declaration void cylinder(float r, float h, float *csa, float *tsa, float *vol); @@ -30,7 +29,7 @@ int main(){ //function definition void cylinder(float r, float h, float *csa, float *tsa, float *vol){ - *csa = 2*r*h*PI; - *tsa = 2*r*(h+r)*PI; - *vol = r*r*h*PI; -} \ No newline at end of file + *csa = 2*r*h*(22.0/7); + *tsa = 2*r*(h+r)*(22.0/7); + *vol = r*r*h*(22.00/7); +} From f78735902052ec3bfee059c0632a344803aa6d5f Mon Sep 17 00:00:00 2001 From: Bibek1985 <71976396+Bibek1985@users.noreply.github.com> Date: Wed, 30 Sep 2020 23:42:06 +0530 Subject: [PATCH 2/2] Update forloop.c --- c/forloop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/forloop.c b/c/forloop.c index 79bce71..d5d9154 100644 --- a/c/forloop.c +++ b/c/forloop.c @@ -2,7 +2,7 @@ int main(){ //declaring variables int i,n; - + printf("Enter value of n:\n") //reading value of n scanf("%d",&n); @@ -11,4 +11,4 @@ int main(){ printf("%d\n",i); } return 0; -} \ No newline at end of file +}