Java programming

Thursday, January 15, 2009

/*This program determine a piramide sample input 5 output $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ */ import java.io.*; class b710 { public static void main(String args[])throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); //DataInputStream in=new DataInputStream (System.in); System.out.println("Enter your number:"); int c=Integer.parseInt(in.readLine()); System.out.println("Your result is:"); for(int d=c;d!=0;d--) { for(int m=d;m System.out.print(" "); for(int b=1;b<=d;b++) { System.out.print("$"); System.out.print(" "); } System.out.println(); } } }

0 comments:

Visitors

PlugIn.ws - Free Hit Counter, Web Site Statistics, Traffic Analysis

  © Blogger template Leaving by Ourblogtemplates.com 2008

Back to TOP