Skip to content

Commit

Permalink
add calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
oxdjww committed Apr 1, 2024
1 parent 65279f5 commit 584f49a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions calculator.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include <stdio.h>

void add()
{
}
void sub()
{
}
void mul()
{
}
void div()
{
}

int main(void)
{
while (1)
{
printf("===== 계산기 프로그램 =====\n");
printf("[*] 연산 선택: ");
int ipt = getchar();
int a = getchar();
int b = getchar();
switch (ipt)
{
case '+':
printf("[*] 더하기를 진행합니다.\n");
add(a, b);
case '-':
printf("[*] 빼기를 진행합니다.\n");
sub(a, b);
case '*':
printf("[*] 곱하기를 진행합니다.\n");
mul(a, b);
case '/':
printf("[*] 나누기를 진행합니다.\n");
div(a, b);
}
}
return 0;
}

0 comments on commit 584f49a

Please sign in to comment.