URI Online Judge Solution 1036 Bhaskara’s Formula – URI 1036 Solution in C, C++, Java, Python and C#

URI Online Judge Solution URI Solution -Beginner

URI Online Judge Solution 1036 Bhaskara’s Formula – URI 1036 Solution in C, C++, Java, Python and C#

URI Online Judge Solution 1036 Bhaskara’s Formula | Beginner
URI Problem Link – https://www.urionlinejudge.com.br/judge/en/problems/view/1036

Problem Name: 1036 Bhaskara’s Formula solution
Problem Number : URI – 1036 Bhaskara’s Formula code
Online Judge : URI Online Judge Solution
Category: Beginner
Solution Language : C,C plus plus, java, python, c#(c sharp)

URI Solution 1036 Bhaskara’s Formula Code in C / URI 1036 solution in C:

#include<stdio.h>
#include <math.h>

int
main()
{

double
a, b, c, t;
scanf("%lf %lf %lf", &a, &b, &c);

if
(((b * b) - 4 * a * c) < 0 || a == 0){
printf("Impossivel calcularn");
}

else
{
t = sqrt((b * b) - 4 * a * c);
printf("R1 = %.5lfnR2 = %.5lfn", ((-b + t) / (2 * a)), ((-b - t) / (2 * a)));
}

return
0;
}

URI Solution 1036 Bhaskara’s Formula Code / URI 1036  solution in CPP:

#include<stdio.h>
#include <math.h>

int
main()
{

double
a, b, c, t;
scanf("%lf %lf %lf", &a, &b, &c);

if
(((b * b) - 4 * a * c) < 0 || a == 0){
printf("Impossivel calcularn");
}

else
{
t = sqrt((b * b) - 4 * a * c);
printf("R1 = %.5lfnR2 = %.5lfn", ((-b + t) / (2 * a)), ((-b - t) / (2 * a)));
}

return
0;
}

URI Solution 1036 Bhaskara’s Formula Code / URI 1036  solution in Java:

import java.util.Scanner;

public class
Main {

public static
void main(String[] args) {
double
A, B, C, R1, R2;
Scanner input =new Scanner(System.in);
A = input.nextDouble();
B = input.nextDouble();
C = input.nextDouble();

if
((A == 0) || (((B*B) -(4*A*C)) < 0)) {
System.out.print("Impossivel calcularn");
}
else {
R1 = ((-B + Math.sqrt(((B*B) -(4*A*C)))) / (2*A));
R2 = ((-B - Math.sqrt(((B*B) -(4*A*C)))) / (2*A));

System.out.printf("R1 = %.5fn", R1);
System.out.printf("R2 = %.5fn", R2);
}


}

}

URI Solution 1036 Bhaskara’s Formula Code / URI 1036  solution in  Python:

URI Solution 1036 Bhaskara’s Formula Code / URI 1036  solution in  C# (C Sharp):

Demonstration:

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 Bhaskara’s Formula code in C, URI 1036  code in C++, URI  Bhaskara’s Formula solution in C, URI solution, URI 1036 Bhaskara’s Formula solution in C,URI 1036  solution in C++-CPP,URI 1036  solution in C# (C sharp),URI 1036 Bhaskara’s Formula solution in Java,URI 1036  solution in Python,

Leave a Reply

Your email address will not be published.