Compare commits

..

2 commits

Author SHA1 Message Date
Nash Brooks
ed18a3201a added some spaces in quadratic.c as well 2022-01-23 05:59:49 -05:00
Nash Brooks
098d750e47 added a bunch of spaces 2022-01-23 05:56:35 -05:00
2 changed files with 8 additions and 10 deletions

View file

@ -4,28 +4,26 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number
int x; //idk what types are i think this is a 32bit signed int... idk @quantum help... also should this even be here or should it be out of main int x; //idk what types are i think this is a 32bit signed int... idk @quantum help... also should this even be here or should it be out of main
if(argc != 2){ if (argc != 2) {
puts("fix your arguments"); puts("fix your arguments");
return 0; //idk if this is how i should return an error idk @quantum rip my code to shreads return 0; //idk if this is how i should return an error idk @quantum rip my code to shreads
} }
x = atoi(argv[1]); //mmmm yes the atoi is made out of atoi x = atoi(argv[1]); //mmmm yes the atoi is made out of atoi
if(x == 0){ if (x == 0) {
puts("uhhhh you entered 0 this wont end"); puts("uhhhh you entered 0 this wont end");
return 0; return 0;
} } else {
else{
printf("Got: %d\n", x); printf("Got: %d\n", x);
} }
while(x != 1){ //while x is not true i think while (x != 1) { //while x is not true i think
printf("%d\n",x ); //shit like this was difficualt in asm because i had to preserve all my registers printf("%d\n",x ); //shit like this was difficualt in asm because i had to preserve all my registers
if(x & 1 == 1){ //if x is odd if (x & 1 == 1) { //if x is odd
x = (3 * x) + 1; x = (3 * x) + 1;
} } else { //elses should be on the same line as the } from the above if
else{
x = x / 2; x = x / 2;
} }

View file

@ -12,7 +12,7 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number
printf("%f\n", pi); //did i print pi corectly??? printf("%f\n", pi); //did i print pi corectly???
if(argc != 4){ if (argc != 4) {
puts("please provide a b c"); puts("please provide a b c");
return 0; //idk if this is how i should return an error idk @quantum rip my code to shreads return 0; //idk if this is how i should return an error idk @quantum rip my code to shreads
} }
@ -26,7 +26,7 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number
deter = (b^2)-(4*a*c); deter = (b^2)-(4*a*c);
//deter = 12f; //deter = 12f;
printf("Deter = %f\n", deter); printf("Deter = %f\n", deter);
if(deter < 0){ if (deter < 0) {
puts("deter is negitve this will result in a imaginary number"); puts("deter is negitve this will result in a imaginary number");
return 0; return 0;
} }