Wednesday, November 24, 2010

prg.no:2 to form given data by the form lines

//to form given data by the form lines

#include
#include
Void main()
{
int r,q,I,n,cnt=0;
clrscr();
printf(“\n enter the no:”);
scanf(“%d”,&n);
q=n;
While(q)
{
R=q%10;
q=q/10;
cnt++;
}
for(i=pow(10,cnt),q=n;i>1;i=i/10)
{
r=q/I;
Printf(“%d\n”,r);
}

getch();
}

Sample input: 5789
Sample output:
5789
789
89
9

No comments:

Post a Comment