patternprogram_413 softethics

Pattern 413 (String Pattern)

C

#include <stdio.h>
#include <string.h>
int main()
{
  //A char array to hold the string and print a single char at a time.

  char arr[]="SUMIT";

  int len=strlen(arr) ;
  int i,j;

  for (i=len-1; i>=0; i--)
  {
    for (j=0; j<=i; j++)
    {
      printf("%c ",arr[j]);
    }
    printf("\n");
  }

  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