Pattern 22

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

C Code


        1
      1 2 3
    1 2 3 4 5
  1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9 
#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=1;k<=z;k++) { printf("%d",k); } z+=2; printf("\n"); } getch(); }

C++ Code


        1
      1 2 3
    1 2 3 4 5
  1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9 
#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=1;k<=z;k++) { cout<<k; } z+=2; cout<<endl; } getch(); }

Java Code


        1
      1 2 3
    1 2 3 4 5
  1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9 
class Pattern_22 { 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=1;k<=z;k++) { System.out.print(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 !!!