#include<stdio.h>
void main()
{
float sum
,sub
,mul
,div,a
,b
; int choice,mod;
printf("Enter the values of a and b\n"); printf("Enter 1 for addition\n2 for subtraction\n3 for multiplication\n4 for division\n5 for modulus\n"); scanf("%d%d",&choice
,&mod
); switch(choice)
{
sum=a+b;
break;
sub=a-b;
break;
case 3:printf("Multiplication"); mul=a*b;
break;
if(b==0)
{
printf("Divide by zero error! please enter a non zero number."); }
else
{
break;
}
if(a<b)
mod=a;
else
mod=(int)a%(int)b;
break;
Default
:printf("Wrong choice, enter correct choice"); }
}
I2luY2x1ZGU8c3RkaW8uaD4Kdm9pZCBtYWluKCkKewoJZmxvYXQgc3VtLHN1YixtdWwsZGl2LGEsYjsKCWludCBjaG9pY2UsbW9kOwoJcHJpbnRmKCJFbnRlciB0aGUgdmFsdWVzIG9mIGEgYW5kIGJcbiIpOwoJc2NhbmYoIiVmJWYiLCZhLCZiKTsKCXByaW50ZigiRW50ZXIgMSBmb3IgYWRkaXRpb25cbjIgZm9yIHN1YnRyYWN0aW9uXG4zIGZvciBtdWx0aXBsaWNhdGlvblxuNCBmb3IgZGl2aXNpb25cbjUgZm9yIG1vZHVsdXNcbiIpOwoJc2NhbmYoIiVkJWQiLCZjaG9pY2UsJm1vZCk7Cglzd2l0Y2goY2hvaWNlKQoJewoJCWNhc2UgMTpwcmludGYoIkFkZGl0aW9uIik7CgkJCQlzdW09YStiOwoJCQkJcHJpbnRmKCIlZiIsc3VtKTsKCQkJCWJyZWFrOwoJCWNhc2UgMjpwcmludGYoIlN1YnRyYWN0aW9uIik7CgkJCQlzdWI9YS1iOwoJCQkJcHJpbnRmKCIlZiIsc3ViKTsKCQkJCWJyZWFrOwoJCWNhc2UgMzpwcmludGYoIk11bHRpcGxpY2F0aW9uIik7CgkJCQltdWw9YSpiOwoJCQkJcHJpbnRmKCIlZiIsbXVsKTsKCQkJCWJyZWFrOwoJCWNhc2UgNDpwcmludGYoIkRpdmlzaW9uIik7CgkJCQlpZihiPT0wKQoJCQkJewo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