/* Input : World
Output :
W
Wo
Wor
Worl
World */
void main()
{
char wrd[15];
cout<<"\n Enter a String :";
cin.getline(wrd,15);
for(int i=0; wrd[i] != '\0' ; ++i)
{ for(int j=0; j<=i; ++j)
cout<
cout<<"\n";
}
}
Output :
W
Wo
Wor
Worl
World */
#include <iostream.h>
#include <conio.h>
#include<string.h>void main()
{
char wrd[15];
cout<<"\n Enter a String :";
cin.getline(wrd,15);
for(int i=0; wrd[i] != '\0' ; ++i)
{ for(int j=0; j<=i; ++j)
cout<
cout<<"\n";
}
}
No comments:
Post a Comment