C/Console
간단한 4칙연산 입출력
고기상추밥
2018. 11. 10. 00:22
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include <stdio.h> int main() { float x = 0.f; float y = 0.f; float sum = 0.f; float minus = 0.f; float multiply = 0.f; float divide = 0.f; printf("Type two numbers :: "); scanf_s("%f %f", &x, &y);
sum = x + y;
minus = x - y;
multiply = x * y;
divide = x / y; printf("The sum is %f\n", sum); printf("The minus is %f\n", minus); printf("The multiply is %f\n", multiply); printf("The divide is %f\n", divide);
return 0; } | cs |