Calculating Radius, Diameter, Circumference , Area and Length of a Circle
Write a program that asks a user to
input the radius and degree of a circle, the program reads it in and
calculates: The radius, Diameter, Circumference, Area and Length of a circle.
SOLUTION
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
/*Initialization phase */
int radius; // radius to be entered by the user
int degree; // degree to be entered by the user
printf("Insert radius and degree of the circle:"); /*Prompting for input */
scanf("%d%d", &radius, °ree); /*reading radius and degree from user */
printf("Radius is:%f\n", radius*1.0); /*displaying result
printf("Diameter is:%f\n", radius*2.0); /*displaying result
printf("Circumference is :%f\n", radius*2*3.1415); /*displaying result
printf("Area is:%f\n", radius*radius*3.1415); /*displaying result
printf("Length is:%f\n",radius*2*3.1415*degree/360); /*displaying result
return 0; /* indicates that program ended successfully */
}
Hotel Casinos in Las Vegas - Mapyro
ReplyDeleteFind 거제 출장샵 all hotel and casino info and reviews on 17777 광주 출장마사지 hotels near Casino of the Sky at 천안 출장안마 3475 창원 출장마사지 Las Vegas Blvd 시흥 출장안마 S in Las Vegas, NV.