-
-
Save jacobhenke/0471cf1285bbd7d7b901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// help | |
// | |
// Created by Jacob Henke on 2/3/16. | |
// Copyright © 2016 Jacob Henke. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <math.h> | |
int main(int argc, const char * argv[]) { | |
float a, b, c; | |
float result; | |
printf("Working on a Quadratic formula? Let me help!\nA="); | |
scanf("%f",&a); | |
printf("B="); | |
scanf("%f",&b); | |
printf("C="); | |
scanf("%f",&c); | |
result =pow(b, 2) - (4*a*c); | |
printf("A=%f\nB=%f\nC=%f\n",a,b,c); | |
if ( result < 0) | |
printf("You have a non-real answer on your hands.\n"); | |
else | |
printf("%f\n", result); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment