#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;
}
#include <iostream.h>
#include <string.h>
int main()
{
char str[] = "SoftEthics";
int x = strlen(str)-1;
int shift=4;
for(int i = 0; i < shift; i++)
{
for(int j = 0; j < shift; j++)
{
cout<<str[x--]<<" ";
if (x == -1)
x = strlen(str) - 1;
}
cout<<endl;
}
return 0;
}
class PatternProg
{
public static void main(String args[])
{
String str = "SoftEthics";
int x = str.length() - 1;
int shift = 4;
for (int i = 0; i < shift; i++)
{
for (int j = 0; j < shift; j++)
{
System.out.print(str.charAt(x--)+" ");
if (x == -1)
{
x = str.length() - 1;
}
}
System.out.println();
}
}
}
using System;
class PatternProg
{
public static void Main()
{
string str = "SoftEthics";
int x = str.Length - 1;
int shift = 4;
for (int i = 0; i < shift; i++)
{
for (int j = 0; j < shift; j++)
{
Console.Write(str[x--] + " ");
if (x == -1)
{
x = str.Length - 1;
}
}
Console.WriteLine();
}
Console.ReadKey(true);
}
}
string = "SoftEthics"
d = len(string) - 1
shift = 4
for x in range(0, shift):
for y in range(0, shift):
print(string[d] + " ", end="")
d -= 1
if d == -1:
d = len(string) - 1
print()