Welcome

>>>Welcome to my "CODE BAZAR"
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others

Update ✔✔✔ Upcoming programming book (.pdf) "Programming Contest (data structures and algorithms) by Md. Mahbub Hasan & "Graph Algorithms" by Safayat Asraf "****** Date: 20 March, 2019****Hazrat Ali****

Saturday, 5 November 2016

URI-1002

URI Online Judge | 1002

Area of a Circle

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem link Click here
The formula to calculate the area of a circumference is defined as A = π . R2. Considering to this problem that π3.14159:
Calculate the area using the formula given in the problem description.

Input

The input contains a value of floating point (double precision), that is the variable R.

Output

Present the message "A=" followed by the value of the variable, as in the example bellow, with four places after the decimal point. Use all double precision variables. Like all the problems, don't forget to print the end of line after the result, otherwise you will receive "Presentation Error".
Input SamplesOutput Samples
2.00A=12.5664
100.64A=31819.3103
150.00A=70685.7750

Solution

#include<stdio.h>
int main()
{
    float a,pi=3.14159,result;
    scanf("%f",&a);
    result=pi*a*a;
    printf("A=%.4f\n",result);
    return 0;
}


No comments:

Post a Comment