patternprogram_416 softethics

Pattern 416 (String Pattern)

C

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

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

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