9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia01/ej6.c (274B)
   1 #include <stdio.h>
   2 #include <math.h>
   3 
   4 
   5 int main( void ) {
   6 
   7     int a, b, c;
   8     float x1, x2;
   9     
  10     a =  1;
  11     b = -12;
  12     c =  36;
  13 
  14     x1 = ((-b) + sqrtf( (b*b)-(4*a*c) )) / (2*a);
  15     x2 = ((-b) - sqrtf( (b*b)-(4*a*c) )) / (2*a);
  16 
  17     printf("x1 = % .2f\nx2 = % .2f\n", x1, x2);
  18 
  19     return 0;
  20 }