Search This Blog

Tuesday 23 November 2021

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

//1. C Program to read radius and find area, volume of a sphere.

#include<stdio.h>

#define PI 3.1428

void main()

{

 

     int radius;

     float area, volume;

     clrscr();

     printf("Enter the radius:");

     scanf("%d",&radius);

     area=4*PI*radius*radius;

     volume=4/3*PI*radius*radius*radius;

     printf("Area of Sphere=%f\n",area);

     printf("Volume of Sphere=%f\n",volume);

     getch();

}

No comments :

Post a Comment

FREE Hit Counters