C2021. 12. 8. 00:57[C언어] 기본 연산자( + , - , * , / , % )

1. 덧셈 : 기호 '+' - 출력할 때 더한 값을 따로 저장하지 않고 바로 출력 가능. - 더한 값을 변수에 저장하는 것도 가능. cf) 정수와 실수를 더한 값은 실수형 자료형에 저장하여야 한다. //정수 덧셈 #include int main() { int a = 1; int b = 2; printf(" a + b = %d", a+b); return 0; } // 출력값 : a + b = 3 //실수 덧셈 #include int main() { float a = 1.3f; float b = 1.2f; printf("a + b = %f",a+b); return 0; } // 출력값 : a + b = 2.500000 //정수와 실수 덧셈 #include int main() { int a = 2; float..

image