-
Notifications
You must be signed in to change notification settings - Fork 1
/
arey-calculater.c
60 lines (50 loc) · 950 Bytes
/
arey-calculater.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include<stdio.h>
void main()
{
int a[5],b[5],i;
char x;
printf("enter first array \n");
for (i = 0; i < 5; i++)
{
printf("enter a number \n");
scanf("%d",&a[i]);
}
printf("enter secand array \n");
for (i = 0; i < 5; i++)
{
printf("enter a number \n");
scanf("%d",&b[i]);
}
printf("select a opperaction \n");
fflush(stdin);
scanf("%c",&x);
switch(x)
{
case '+':
{
for (i = 0; i < 5; i++)
printf("%d \n",a[i]+b[i]);
break;
}
case '-':
{
for (i = 0; i < 5; i++)
printf("%d \n",a[i]-b[i]);
break;
}
case '*':
{
for (i = 0; i < 5; i++)
printf("%d \n",a[i]*b[i]);
break;
}
case '/' :
{
for (i = 0; i < 5; i++)
printf("%d \n",a[i]/b[i]);
break;
}
default:
printf("invalid slection \n");
}
}