C   199
Untitled
Guest on 20th August 2022 04:13:17 AM

1. #include<stdio.h>
4. {
5.     int z;
6.     z=x+y;
7.     return z;
8. }
9. //funtion for multification
10. int multi(int x,int y)
11. {
12.     int z;
13.     z=x*y;
14.     return z;
15. }
16. //funtion for substration
17. int sub(int x,int y)
18. {
19.     int z;
20.     z=x-y;
21.     return z;
22. }
23. //funtion for devaition
24. float dev(float x,float y)
25. {
26.     float z;
27.     z=x/y;
28.     return z;
29. }
30. int main()
31. { //declare variable
32.     double a,b,c,d;
33.     int ch;
34.     //input for geting oparent
35.     printf("which operate you want to use?\nInput the number:\n1:+\n2:-\n3:*\n4:/\n");
36.     scanf("%d",&ch);
37.
38.     //Input section
39.     printf("Input first number:");
40.     scanf("%lf",&a);
41.
42.     printf("Input 2nd number:");
43.     scanf("%lf",&b);
44.     //caling variable
45.
46.     if(ch==1)
47.     {
50.     }
51.     else if(ch==2)
52.     {
53.         d=sub(a,b);
54.         printf("The substraction is:%d",d);
55.     }
56.     else if(ch==3)
57.     {
58.         d=multi(a,b);
59.         printf("The multification is:%d",d);
60.     }
61.     else if(ch==4)
62.     {
63.         d=dev(a,b);