Computer Programming with Engineering Applications Assignment 2 1. (100 pts) Wri
ID: 640158 • Letter: C
Question
Explanation / Answer
#include <stdio.h>
#include <conio.h>
#include <math.h>
float c[3];
// following funcion determines and returns determinent of the quadratic equation
float determinent(float a, float b, float c){
return (b * b) - (4 * a * c);
}
int main(){
float a, b, c;
printf("Equation is of the form ax^2+bx+c=0 ");
printf("Enter a, b, c: ");
scanf("%f%f%f", &a, &b, &c);
float det = determinent(a, b, c);
if(det > 0){
printf("Two Dinstinct Roots ");
}
else if(det == 0){
printf("Two equal roots ");
}
else{
printf("No real roots ");
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.