patternprogram_10_softethics

Pattern 10

C


#include<stdio.h>

int main()
{
  int i,j;

  for(i=1; i<=5; i++)
  {
    for(j=1; j<=3; j++)
    {
      printf("%d %d ",j,i);
    }
    printf("\n");
  }
  return 0;
}

C++


 #include<iostream.h>
 
 int main()
 {
 
 for(int i=1;i<=5;i++)
 {
 for(int j=1;j<=3;j++)
 {
 cout<<j<<" "<<i<<" ";
 }
 cout<<endl;
 }
 return 0;
 }

Java


  class PatternProg
  {
  public static void main(String args[])
  {
    for(int i=1; i<=5; i++)
    {
      for(int j=1; j<=3; j++)
      {
        System.out.print(j+" "+i+" ");
      }
      System.out.println();
    }
  } //end of main
}  //end of class

C#


using System;

class PatternProg
{
  public static void Main()
  {
    for (int i = 1; i <= 5; i++)
    {
      for (int j = 1; j <= 3; j++)
      {
        Console.Write(j + " " + i + " ");
      }
      Console.WriteLine();
    }
    Console.ReadKey(true);
  } //end of main
} //end of class

Python


for x in range(1, 6):
    for y in range(1, 4):
        print("{} {} ".format(y, x), end="")
    print()
5 1 vote
Rate this Program
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments