Pattern Printing

Published on November 2016 | Categories: Documents | Downloads: 24 | Comments: 0 | Views: 92
of 1
Download PDF   Embed   Report

Pattern PrintingJava Code

Comments

Content

import java.io.*; public class Main { public static void main(String args[]) throws IOException { int i,j,k,l; int N; BufferedReader input=new BufferedReader(new InputStreamReader(System.in));

for(l=0;l<3;l++) { N=Integer.parseInt(input.readLine());

for(i=0;i<N;i++) { for(k=N-i;k>0;k--) System.out.print(" "); for(j=0;j<=i;j++) System.out.print((i+1)+" "); System.out.println(); } }

} }

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close