C
c
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
27
28
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char command[80],temp[80];
int i,j;
for( ; ; ){
printf("COMMAND?\n");
gets(command);
if(!strcmp(command,"quit")) break;
printf("give\n ");
gets(temp);
i=atoi(temp);
printf("give another\n");
gets(temp);
j=atoi(temp);
if(!strcmp(command,"add")) printf("%d",i+j);
else if(!strcmp(command,"subtract")) printf("%d",i-j);
else if(!strcmp(command,"divide")) printf("%.2f",i/j);
else if(!strcmp(command,"multiply"))printf("%d",i*j);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run