URI Online Judge | 1002 Area of a Circle (Solution)

Problem Link:
https://www.urionlinejudge.com.br/judge/en/problems/view/1002

URI Online Judge | 1002

Area of a Circle

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
The area of the circle is defined as A = π . R2, having π as 3.14159.
Calculate the area using the formula given in the problem description.

Input

Read the variable R (double precision), that is the radius of the circle.

Output

Print the variable A, rounded to four decimal digits.
Sample InputsSample Outputs
2.00A=12.5664
100.64A=31819.3103
150.00A=70685.7750
Solution:

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

Comments

  1. where is my problem.

    #include

    int main() {
    double A,R;
    double pi=3.14159;
    scanf("%lf",&A);
    R=pi*A*A;
    printf("%.4lf",R);

    return 0;
    }

    ReplyDelete
    Replies
    1. Vai problem ta valo kore poren.
      Apni ultakaj korcen.

      R = pi*A*A-er jaygay A = pi*R*R bosan.

      Delete

Post a Comment

Popular posts from this blog

URI Online Judge | 1036 Bhaskara's Formula (Solution)

URI Online Judge | 1043 Triangle (Solution)

URI Online Judge | 1042 Simple Sort (Solution)