Elementary operations with small integers:
Refer Find Sum also.
Output :x=5,y=7
z=x-y=-2
z=x*y=35
z=x/y=0
z=y/x=1
z=x%y=5
z=y%x=2
=========================================================================
Back to Home & C
Refer Find Sum also.
#include<stdio.h> #include<conio.h> main() { clrscr(); printf("\n\t\n\t"); printf("x=%d,y=%d\n",x,y); z=x-y; printf("z=x-y=%d\n",z); z=x*y; printf("z=x*y=%d\n",z); z=x/y; printf("z=x/y=%d\n",z); z=y/x; printf("z=y/x=%d\n",z); z=x%y; printf("z=x%%y=%d\n",z); z=y%x; printf("z=y%%x=%d\n",z); getch(); } |
Output :x=5,y=7
z=x-y=-2
z=x*y=35
z=x/y=0
z=y/x=1
z=x%y=5
z=y%x=2
=========================================================================
Back to Home & C
No comments:
Post a Comment