Sunday 20 October 2013

Add , Sub , Mul , Div , Mod in C

#include <stdio.h>
#include<conio.h>
void main()
{
int x,y,add,sub,mul,mod;
        float div;
printf("enter two numbers:");
scanf("%d %d",&x,&y);
add=x+y;
        sub=x-y;
        div=x/y;
        mul=x*y;
        mod=x%y;
printf("the sum is =%d",add);
printf("the sub is =%d",sub);
printf("the mul is =%d",mul);
printf("the div is =%f",div);
printf("the mod is =%d",mod);
        getch();
}

No comments :

Post a Comment