Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Simple Calculator v1.0
//gcc 5.4.0 #include <stdio.h> int main(void) { double a; double b; int op; double c; printf("Please input 2 values and select an operation\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Division\n-------------------------------------------------------------\nExample Input:\n2\n2\n1\n2+2=4\n----------------------------------------------------------------------------\nYour Input and Equation:\n%lf\n%lf\n%lf\n",a,b,op); scanf("%lf%lf%d",&a,&b,&op); switch(op){ case 1: c=a+b; printf("%lf+%lf=%lf",a,b,c); break; case 2: c=a-b; printf("%lf-%lf=%lf",a,b,c); break; case 3: c=a*b; printf("%lf*%lf=%lf",a,b,c); break; case 4: c=a/b; printf("%lf/%lf=%lf",a,b,c); break; default: printf("Operatoration not Found"); break; } }
run
|
edit
|
history
|
help
0
Undefined argument processing order in C
FloatInt
Lab 8 part 2 v.06
18BCE2182 ASSESS_3 Q3
1.3 Max threads
Divisibility :- #simple-math #ad-hoc-1 #basics
test
19_1_7
Busqueda binaria version recursiva
20171030_TRIANGULO