patternprogram_415 softethics

Pattern 415 (String Pattern)

C

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

int main()
{
  char arr[] = "SUMIT";
  int n = strlen(arr);
  int i,j,k;


  for(i = 0; i < n; i++)
  {
    for(j = i; j > 0; j--)
    {
      printf("  ");
    }

    for(k = 0; k < n - i; k++)
    {
      printf("%c ", arr[k]);
    }
    printf("\n");
  }
  return 0;
}

C++

Java

C#

Python

5 1 vote
Rate this Program
Subscribe
Notify of
guest


0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments