Pattern program 10 on May 11, 2015 Get link Facebook X Pinterest Email Other Apps public class pattern10 { public static void main ( String arg[] ){ int ln = 5 , p=1; for(int i=0;i<ln;i++){ for(int s=ln-1;s>i;s--){ System.out.print(" "); } for(int j=0;j<=i*2;j++){ System.out.print(p); p = (p==1)?0:1; } System.out.println(); } }} Comments
Comments
Post a Comment