idk i think i fixed it i cant remember

This commit is contained in:
Nash Brooks 2022-01-23 06:27:26 -05:00
parent ed18a3201a
commit fcdab38217
2 changed files with 4 additions and 8 deletions

BIN
a.out

Binary file not shown.

View file

@ -1,16 +1,12 @@
#include <stdio.h> //printf and shit
#include <math.h> //website told me to use fabs for floating point absolute value
#include <math.h> //website told me to use fabs for floating point absolute value. this also has sqrt (sqrt for somereason needs the -lm compile flag)
#include <stdlib.h> //this has atoi which i forgot to incled but it still combiled idk dont @ me
int main( int argc, char *argv[] ) { //yoinked from the internet argc is number of args and argv is a "array of arguments"
int a, b, c; //uhhhhhh how to ascii to float
float x, deter, plusans, minusans;
const float pi = 3.1415926535897932384626338f;
printf("%f\n", pi); //did i print pi corectly???
float deter, plusans, minusans;
if (argc != 4) {
puts("please provide a b c");
@ -23,7 +19,7 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number
printf("Got: %dx²+%dx+%d\n", a, b, c); //wow this looks like ass
deter = (b^2)-(4*a*c);
deter = (b*b)-(4*a*c);
//deter = 12f;
printf("Deter = %f\n", deter);
if (deter < 0) {