diff --git a/calculator.c b/calculator.c index 71fe13a..76ab076 100644 --- a/calculator.c +++ b/calculator.c @@ -2,11 +2,12 @@ main() { char chc; - float a,b,c; + float a,b,c,delta; puts("+ for Addiction"); puts("- for Substraction"); puts("* for Multiplication"); puts("/ for Division"); + puts("$ for findind the delta"); puts("Select your choice :"); fflush (stdin); chc = getchar(); @@ -32,6 +33,12 @@ main() c=a/b; printf("The answer is %f",c); break; + case '$': + printf("Enter the value for c :"); + scanf("%f",&c); + delta=b*b-(4*a*c); + printf("The answer of delta is %f",delta); + break; default : puts("Syntax Error"); }