#include <stdio.h>
int main()
{
int a,b,c,d,e,f,g,h,i;
printf("It is a program calculator\n");
printf("Press 1 to add \n Press 2 to sub \n Press 3 to multi \n Press 4 to div\n ");
scanf("%d",&a);
switch(a)
{
case 1:
scanf("%d%d",&b,&c);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",b+c);
break;
case 2:
scanf("%d%d",&d,&e);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",d-e);
break;
case 3:
scanf("%d%d",&f,&g);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",f*g);
break;
case 5:
scanf("%d%d",&h,&i);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",h/i);
break;
}
return 0;
}
int main()
{
int a,b,c,d,e,f,g,h,i;
printf("It is a program calculator\n");
printf("Press 1 to add \n Press 2 to sub \n Press 3 to multi \n Press 4 to div\n ");
scanf("%d",&a);
switch(a)
{
case 1:
scanf("%d%d",&b,&c);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",b+c);
break;
case 2:
scanf("%d%d",&d,&e);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",d-e);
break;
case 3:
scanf("%d%d",&f,&g);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",f*g);
break;
case 5:
scanf("%d%d",&h,&i);
printf("Enter the first number: ");
printf("Enter the secound number:");
printf("%d%d",h/i);
break;
}
return 0;
}
No comments:
Post a Comment