TUGAS II (PERSAMAAN KUADRAT)

9

#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int a=1;
int b=-4;
int c=-5;
int d;
int x1;
int x2;
d= sqrt((b*b)-(4*a*c));
x1=(-b+d)/(2*a);
x2=(-b-d)/(2*a);
cout<<x1<<endl;
cout<<x2<<endl;
return 0;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s


%d bloggers like this: