Pattern 24

Pattern 24
  • C Code
  • C++ Code
  • Java Code
  • Get these codes on your Android Device

C Code


        1
      3 2 1
    5 4 3 2 1
  7 6 5 4 3 2 1
9 8 7 6 5 4 3 2 1 
#include<stdio.h> #include<conio.h> void main() { int n=5; //size int z=1; int i,j,k; clrscr(); for(i=0;i<n;i++){ for(j=n-1;j>i;j--) { printf(" "); } for(k=0;k<z;k++) { printf("%d",z-k); } z+=2; printf("\n"); } getch(); }

C++ Code


        1
      3 2 1
    5 4 3 2 1
  7 6 5 4 3 2 1
9 8 7 6 5 4 3 2 1 
#include<iostream.h> #include<conio.h> void main() { int z=1; clrscr(); for(int i=0;i<5;i++){ for(int j=4;j>i;j--) { cout<<" "; } for(int k=0;k<z;k++) { cout<<z-k; } z+=2; cout<<endl; } getch(); }

Java Code


        1
      3 2 1
    5 4 3 2 1
  7 6 5 4 3 2 1
9 8 7 6 5 4 3 2 1 
class Pattern_24 { public static void main(String args[]) { int n=5; //size int z=1; for(int i=0;i<n;i++){ for(int j=n-1;j>i;j--) { System.out.print(" "); } for(int k=0;k<z;k++) { System.out.print(z-k); } z+=2; System.out.println(); } } //end of main } //end of class

Android Apps


Get pattern printing codes on your Android Device :

# C Pattern Programs Free App
# C++ Pattern Programs Free App
# Java Pattern Programs Free App


Get Them Now !!!

Download Code           More Patterns !!!