How to find volume of cylinder?

CODE




How to find volume of cylinder?

//Write a program to find volume of cylinder using pointer..

int main()
{
    float r,h,v,*pr,*ph,*pv;
    printf("\n enter radius and height :");
    scanf("%f%f",&r,&h);
    pr=&r;
    ph=&h;
    pv=&v;
    *(pv)=3.14*(*pr)*(*pr)*(*ph);
    printf("\n volume of cylinder=%f",v);
}

Output:

enter radius and height :
4
7

 volume of cylinder=351.679993


How to find volume of cylinder? How to find volume of cylinder? Reviewed by Unknown on December 31, 2018 Rating: 5

No comments:

If you have any doubt or query ,comment below:

Programming copyright © 2018-19. Powered by Blogger.