patternprogram_5_softethics

Pattern 5

C

 #include<stdio.h>
 int main()
 {
   int i,j;
   for(i=5; i>=1; i--)
   {
     for(j=5; j>=1; j--)
     {
       printf("%d",j);
     }
     printf("\n");
   }
   return 0;
 }

C++

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

Java

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

C#

 using System;
 class PatternProg
 {
   public static void Main()
   {
     for (int i = 5; i >= 1; i--)
     {
       for (int j = 5; j >= 1; j--)
       {
         Console.Write(j);
       }
       Console.WriteLine();
     }
     Console.ReadKey(true);
   } //end of main
 } //end of class

Python

for x in range(5, 0, -1):
     for y in range(5, 0, -1):
         print(y, end="")
     print()

Tutorial (YouTube)

5 1 vote
Rate this Program
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments