
21-12-2005, 19:06
|
|
|
|
חבר מתאריך: 09.11.05
הודעות: 71
|
|
|
בעיה קטנה בC
מה הבעיה פה?
קוד:
#include<stdio.h>
#include<math.h>
#include<conio.h>
void main()
{
int a,b,c,delta,x1,x2;
clrscr();
printf("Type 3 numbers\n");
scanf("%d %d %d",&a,&b,&c);
delta=b*b-4*a*c;
if(delta==0)
{
x1=-b/2*a;
printf("x1 is:%d",x1);
}
if(delta<0)
{
printf("There isnt solution");
}
else
x1=-b+(sqrt(delta))/2*a;
x2=-b-(sqrt(delta))/2*a;
printf("x1 is:%d and x2 is:%d",x1,x2);
}
_____________________________________
חתימתכם הוסרה כיוון שלא עמדה בחוקי האתר. לפרטים נוספים לחצו כאן.
|