TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kristo R
NA
1
2.3k
Beginner question about quadratic equation calculator
Sep 12 2012 1:27 PM
I made a quadratic equation calculator but it doesn't work. Any ideas?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace quadratic
{
class quadratic
{
static void Main(string[] args)
{
int a, b, c;
double x1, x2;
Console.Write("Please enter the value of A: ");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("Please enter the value of B: ");
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("Please enter the value of C: ");
c = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
x1 = (-a + Math.Sqrt(b * b - 4 * a * c))/(2 * a);
x2 = (-a - Math.Sqrt(b * b - 4 * a * c))/(2 * a);
Console.WriteLine(x1);
Console.WriteLine(x2);
}
}
}
Reply
Answers (
1
)
how to write a delete program oneself in C
Is there a way i can display all output(that asks user to input) in the same time?