All pastes #261729 Raw Edit

Anonymous

public text v1 · immutable
#261729 ·published 2006-11-29 20:42 UTC
rendered paste body
#include<stdio.h>
#include<conio.h>
#include<math.h>

void ecuatie(int a, int b, int c, float x1, float x2, float d);
void main(){
int a=0,b=0,c=0;
float x1,x2,d;
printf("Coeficientii= aX*X+bX+c=0 \n");
printf("a=");
scanf("%d",&a);
printf("b=");
scanf("%d",&b);
printf("c=");
scanf("%d",&c);
d=(b*b)-(4*a*c);
if(d>=0){
printf("Are radacini reale. \n");
ecuatie(&a,&b,&c,x1,x2,&d);
printf("x1=%.2f \n",x1);
printf("x2=%.2f \n",x2);
}
else
printf("Nu are radacini reale. \n");
}
void ecuatie(int *a, int *b, int *c, float x1, float x2, float *d){
x1=(-(*b)+sqrt((*d)))/(2*(*a));
x2=(-(*b)-sqrt((*d)))/(2*(*a));
}