Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions c/cylinder.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

#include <stdio.h>
#define PI 22/7

//function declaration
void cylinder(float r, float h, float *csa, float *tsa, float *vol);
Expand All @@ -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;
}
*csa = 2*r*h*(22.0/7);
*tsa = 2*r*(h+r)*(22.0/7);
*vol = r*r*h*(22.00/7);
}
4 changes: 2 additions & 2 deletions c/forloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
int main(){
//declaring variables
int i,n;

printf("Enter value of n:\n")
//reading value of n
scanf("%d",&n);

Expand All @@ -11,4 +11,4 @@ int main(){
printf("%d\n",i);
}
return 0;
}
}