URI Online Judge Solution 1002 Area of a Circle - Solution in C, C++, Java, Python and C#
URI Online Judge Solution 1002 Area of a Circle | BeginnerURI Problem Link - 1002 Area of a Circle solution https://www.urionlinejudge.com.br/judge/en/problems/view/1002
Problem Name: 1002 Area of a Circle code
Problem Number : URI - 1002 Area of a Circle solution
Online Judge : URI Online Judge Solution
Category: Beginner
Solution Language : C,C plus plus, java, python, c#(c sharp)
See a video to solve URI 1002 problem solution in C language if you want:
URI Solution 1002 Code in C:
#include<stdio.h> int main() { double R,A; scanf("%lf", &R); A = 3.14159 * R * R; printf("A=%.4lf\n", A); return 0; }
Run URI 1002 code in C:
URI Solution 1002 Code / URI 1002 solution in CPP:
#include <iostream> #include <iomanip> using namespace std; int main(){ double R,A; cin >> R; A = 3.14159 * R * R; cout << "A=" << fixed << setprecision(4) << A << endl; return 0; }
URI Solution 1002 Code / URI 1002 solution in Java:
import java.util.Scanner; public class Main { public static void main(String[] args){ double R,A; Scanner sc = new Scanner(System.in); R = sc.nextDouble(); A = 3.14159 * R * R; System.out.printf("A=%.4f\n", A);
}
}
URI Solution 1002 Code / URI 1002 solution in Python:
raio = float(input()) area = (raio * raio) * 3.14159 print("A=%0.4f" %area)
URI Solution 1002 Code / URI 1002 solution in C# (C Sharp):
using System; class URI { static void Main(string[] args) { double radio, area; radio = Convert.ToDouble(Console.ReadLine()); area = 3.14159 * (radio * radio); Console.WriteLine("A="+area.ToString("0.0000")); Console.ReadKey(); } }
Or In Another in C#
using System;
class URI {
static void Main(string[] args) {
double R = double.Parse(Console.ReadLine());
double A = 3.14159 * R * R;
Console.WriteLine("A={0:0.0000}", A);
}
}
Demonstration:
We've just implemented the logic of are calculating in this line in C and most provably same line in other languages,
A = 3.14159 * R * R;Area of a circle we know that = (Ï€ * r2)
That means = pi * radius2
Just implement this in coding. Since having any problem just put a comment below. Thanks
Tags: URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI area of a circle code in C, URI 1002 code in C++, URI Area of a circle solution in C, URI solution, URI 1002 solution in C,URI 1002 solution in C++-CPP,URI 1002 solution in C# (C sharp),URI 1002 solution in Java,URI 1002 solution in Python,
No comments:
Post a Comment