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>

/*function main begins program execution */
int main(void)

{
/*Initialization phase */
    int radius // radius to be entered by the user

    int degree// degree to be entered by the user

 /*Processing phase */
    printf("Insert radius and degree of the circle:"); /*Prompting for input */

    scanf("%d%d", &radius, &degree);  /*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 */ 

}




Comments

  1. Hotel Casinos in Las Vegas - Mapyro
    Find 거제 출장샵 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.

    ReplyDelete

Post a Comment

Please feel free to comments if you have any ideas, questions and subjection concerning our post and programs

Popular posts from this blog

Body Mass Index Calculator In C

Adding two Integers in Java Application

Calculating Product, sum, difference, and quotient of Five Integers