Example
#include<stdio.h>
#include<conio.h>
void main()
{
float r;
float area,circum,p=3.14;
clrscr();
printf("Enter radius of circle:");
scanf("%f",&r);
area=(p*r*r);
circum=(2*p*r);
printf("\n========Area and circumference of circle==========\n");
printf("\nArea =%.2f",area);
printf("\nCircumference=%.2f",circum);
getch();
}
/*==========================================================================
OUTPUT
Enter radius of circle:4
========Area and circumference of circle==========
Area =50.24
Circumference=25.12 */
#include<stdio.h>
#include<conio.h>
void main()
{
float r;
float area,circum,p=3.14;
clrscr();
printf("Enter radius of circle:");
scanf("%f",&r);
area=(p*r*r);
circum=(2*p*r);
printf("\n========Area and circumference of circle==========\n");
printf("\nArea =%.2f",area);
printf("\nCircumference=%.2f",circum);
getch();
}
/*==========================================================================
OUTPUT
Enter radius of circle:4
========Area and circumference of circle==========
Area =50.24
Circumference=25.12 */
No comments:
Post a Comment