Volume of cylinder

Program:

#include<stdio.h>
int main()
{
float r,pi=3.14,h,v;
printf("Enter radius of cylinder: ");
scanf("%f",&r);
printf("Enter height of cylinder: ");
scanf("%f",&h);
v=pi*r*r*h;
printf("Volume of cylinder: %.2f\n",v);
return 0;

}

Output:



No comments:

Post a Comment

x^y using recursion

Program: #include<stdio.h> int power(int a,int b); int main() { int x,y,ans; printf("Enter x and y:\n "); scanf(...