BCA

C LAB :PART A

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10

C LAB : PART B

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10

Write a C Program to read radius and find area and volume of a sphere.

 

    /*Write a C Program to read radius and find area and volume of a sphere.*/

    #include < stdio.h >
    #include< conio.h>
    void main()
    {
      int radius ;
      float pie=3.14285714286;
      double volume;
      double area_sphere;
        
    printf("\n Enter value of Radius:");
    scanf("%d",&radius);


      /* 4/3 pi r3*/
     volume=(4.0/3.0)*pie*(radius*radius*radius);
    printf("\n Volume of the sphere=%f ",volume);



     /*4 pi r2*/
     area_sphere=4*pie*(radius*radius);
     printf("\n Surface area of the sphere=%f ",area_sphere);
    
    getch();
    }