patternprogram_423 softethics

Pattern 423 (String Pattern)

C

#include<stdio.h>
#include<string.h>

int main()
{
  int c,d;
  char str[]="NtoS"; //put any string
  int stlen=strlen(str);

  for(c=0; c<stlen; c++)
  {
    d=c+1;
    printf("%.*s\n",d,str);
  }

  for(c=stlen-2; c>=0; c--)
  {
    d=c+1;
    printf("%.*s\n",d,str);
  }
  return 0;
}

C++

Java

C#

Python

0 0 votes
Rate this Program
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments