Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion calculator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");
}
Expand Down