Jump to content
Fórum Script Brasil
  • 0

Exercício de Programação – Bhaskara


Question

code.jpg.12aa0c825bdaac7d77a5fca4264539f3.jpg

ALGUÉM PODE ME AJUDAR A ENCONTRAR O ERRO NO CÓDIGO?😰

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("\t\t_____Programa para calcular a raiz quadrada____\n");

            int a, b, c;

            Console.WriteLine("Digite o valor de a: ");
            a = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Digite o valor de b: ");
            b = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Digite o valor de c: ");
            c = Int32.Parse(Console.ReadLine());

            double delta = (b * b )-( 4 * a * c);
            double raiz = Math.Sqrt(delta);

            double r1 = ((-b) + raiz) / (2 * a);
            double r2 = ((-b) - raiz) / (2 * a);

            Console.WriteLine("A raiz 1 é: "+ r1);
            Console.WriteLine("A raiz 2 é: ", r2);


        }
    }
}

 

Edited by JacksAds
Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      148688
    • Total Posts
      644521
×
×
  • Create New...