To print following design -
enter a name , like 'sujan' . Press enter button , and a design will appear like
enter a name , like 'sujan' . Press enter button , and a design will appear like
s
su
suj
suja
sujan
su
suj
suja
sujan
program -
void main()
{
int con,i,j;
char ch[100];
do
{
clrscr();
printf("enter a name = ");
gets(ch);
for(i=0;ch[i]!='\0';i++)
{
{
int con,i,j;
char ch[100];
do
{
clrscr();
printf("enter a name = ");
gets(ch);
for(i=0;ch[i]!='\0';i++)
{
for(j=0;j<=i;j++)
{
printf("%c",ch[j]);
}
printf("\n");
}
printf("\ndo you want to continue ? Press 1 \n");
scanf("%d",&con);
}while(con==1);
getch();
return;
}
{
printf("%c",ch[j]);
}
printf("\n");
}
printf("\ndo you want to continue ? Press 1 \n");
scanf("%d",&con);
}while(con==1);
getch();
return;
}
lets try this ......
0 Comments