#include <iostream>
#include<string.h>
using namespace std;
int main() {
char x[100];
int a,j;
// scanf("%[^\n]s",x);
//int k=;
cin.getline(x,30);
cout<<"Your string is :";
puts(x);
// cout.write(x,10);
for(a=0;a<=strlen(x);a++)
{
for(j=0;j<a;j++)
{
printf("%c",x[j]);
cout.write(x,0);
}
cout<<endl;
}
return 0;
}
#include<string.h>
using namespace std;
int main() {
char x[100];
int a,j;
// scanf("%[^\n]s",x);
//int k=;
cin.getline(x,30);
cout<<"Your string is :";
puts(x);
// cout.write(x,10);
for(a=0;a<=strlen(x);a++)
{
for(j=0;j<a;j++)
{
printf("%c",x[j]);
cout.write(x,0);
}
cout<<endl;
}
return 0;
}
No comments:
Post a Comment