Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Thursday, September 1, 2011

C-41: Simple Calculations

Elementary operations with small integers:

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: