Solve of URI 1002 (Area of a Circle) in C & C++
Problem Description of URI Online Judge 1002:
Problem name: Area of a Circle
Problem level: 4.
Problem category: Beginner.
Points: 4.9 points
Base time limit: 1 second.
Memory limit: 200 MB.
Problem subject: Sequential.
Problem adapted by: Neilor Tonin (Brazil).
Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1002
Solution language: C & C++
My profile: https://www.urionlinejudge.com.br/judge/en/profile/38770
Solution of URI 1002 in C:
//URI online judge 1002 solution in C
//This solution is made and uploaded by Mehedi Hasan Kajol
#include<stdio.h>
int main(void){
double radius, result;
double PI = 3.14159;
scanf("%lf", &radius);
result = PI * radius * radius;
printf("A=%.4lf\n", result);
return 0;
}
//URI online judge 1002 solution in C++
#include<stdio.h>
int main(void){
double radius, result;
double PI = 3.14159;
scanf("%lf", &radius);
result = PI * radius * radius;
printf("A=%.4lf\n", result);
return 0;
}
Solution of URI 1002 in C++:
//URI online judge 1002 solution in C++
//This solution is made and uploaded by Mehedi Hasan Kajol
#include<iostream>
using namespace std;
int main(){
double radius, result;
double PI = 3.14159;
cin >> radious;
result = PI * radious * radious ;
printf("A=%.4lf\n", result); //printf() for precision.
return 0;
}
#include<iostream>
using namespace std;
int main(){
double radius, result;
double PI = 3.14159;
cin >> radious;
result = PI * radious * radious ;
printf("A=%.4lf\n", result); //printf() for precision.
return 0;
}