patternprogram_417 softethics

Pattern 417 (String Pattern)

C

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

int main()
{
  char str[] = "SoftEthics";
  int x = strlen(str)-1;
  int i,j;
  int shift=4;

  for(i = 0; i < shift; i++)
  {
    for(j = 0; j < shift; j++)
    {
      printf("%c ", str[x--]);
      if (x == -1)
        x = strlen(str) - 1;
    }
    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