Thursday 3 October 2013

Arithmetic Operations using C

#include<stdio.h>
main()
{
int a,b,add,sub,mul,div,mod;
printf("\n(There is) none worthy of worship except Allah(Subhanahu wa ta'ala).Muhammad(Sallallahu alayhi wasallam) is Messenger of ALLAH(Subhanahu wa ta'ala).\n");
printf("Enter the numbers: ");
scanf("%d%d",&a,&b);
add=a+b;
sub=a-b;
mul=a*b;
div=a/b;
mod=a%b;
printf("Result of Addition of %d and %d is %d\n",a,b,add);
printf("Result of Subtraction of %d and %d is %d\n",a,b,sub);
printf("Result of Multiplication of %d and %d is %d\n",a,b,mul);
printf("Result of Division of %d and %d is %d\n",a,b,div);
printf("Result of Modular of %d and %d is %d\n",a,b,mod);
}

No comments:

Post a Comment