Skip to main content

기본기 테스트 – 사칙연산 프로그램

복학하고서 C 첫수업에 기본기 테스트를 한다고 사칙연산 프로그램을 작성해보라네요.. #include <stdio.h> int main(void) { int choice, a, b; printf(”계산기 시작\n”); while(1) { printf(”1. 덧셈\n2. 뺄셈\n3. 곱셈\n4. 나눗셈\n5. 종료\n선택 ? ”); scanf(”%d”, &choice); if(choice==5) break; printf(”계산 할 두 정수 입력 : ”); scanf(”%d %d”, &a, &b); switch(choice) { case 1: printf(”덧셈 결과 : %d\n”, a+b); break; […]

Read More