#include<stdio.h>
#include<conio.h>
void main()
{
int *d,*s,i,n,dir;
clrscr();
printf("Enter the number of disk\n");
scanf("%d",&n);
dir=n&1;
for(i=0;i<=n+1;i++)
{
d[i]=1;s[i]=i+1;
}
for(;;)
{
i=s[0];
if(i>n)
break;
printf("Move disk %d from tower%d to tower%d\n",i,d[i]=(d[i]+(i&1?dir:1-dir))%3+1,d[i]);
s[0]=1;
s[i-1]=s[i];
s[i]=i+1;
}
getch();
}
how to write a program that counts automorphic number from 1 to 999
Don't write, it is already written, google for 'cpp'.
Divide it by 1000.
there is no solution of this problem...........that's it..........
Its limited only by available memory.
times 2 plus 1
how to write a program that counts automorphic number from 1 to 999
By learning how to program on C+.
Don't write, it is already written, google for 'cpp'.
Divide it by 1000.
No.
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
there is no solution of this problem...........that's it..........
Its limited only by available memory.
printf ("x")
Write your program and if you are having a problem post it here with a description of the problem you are having. What you are asking is for someone to do your homework for you.
int x= 1; int y= 2;