- This topic has 0 replies, 1 voice, and was last updated 12 years, 5 months ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- The forum ‘C Programming’ is closed to new topics and replies.
Home › Forums › C Programming › To Shift three numbers in Circular Order (Circular_shift )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <br /> #include<stdio.h><br /> #include<ctype.h><br /> #include<conio.h><br /> #include<stdlib.h><br /> <br /> void circular_shift(int &x,int &y,int &z)<br /> {<br /> x=x+y;<br /> y=x-y;<br /> x=x-y;<br /> x=x+z;<br /> z=x-z;<br /> x=x-z;<br /> return;<br /> <br /> }<br /> int main()<br /> {<br /> int a,b,c;<br /> a=5;b=8;c=10;<br /> clrscr();<br /> printf(" n %d %d %d ",a,b,c);<br /> circular_shift(a,b,c);<br /> printf(" n %d %d %d ",a,b,c);<br /> circular_shift(a,b,c);<br /> printf(" n %d %d %d " ,a,b,c);<br /> getch();<br /> return(0);<br /> }<br /> <br /> |