Home Forums C Programming To Shift three numbers in Circular Order (Circular_shift )

Viewing 0 reply threads
  • Author
    Posts
    • #2258
      Anonymous
      Inactive

      #include
      #include
      #include
      #include

      void circular_shift(int &x,int &y,int &z)
      {
      x=x+y;
      y=x-y;
      x=x-y;
      x=x+z;
      z=x-z;
      x=x-z;
      return;

      }
      int main()
      {
      int a,b,c;
      a=5;b=8;c=10;
      clrscr();
      printf(" n %d %d %d ",a,b,c);
      circular_shift(a,b,c);
      printf(" n %d %d %d ",a,b,c);
      circular_shift(a,b,c);
      printf(" n %d %d %d " ,a,b,c);
      getch();
      return(0);
      }

Viewing 0 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.