princess
| Subject: plz help me Tue Jun 10, 2008 8:40 pm | |
| plz help me complete these programs 1)wap to display the following output 1 1 12 3 123 6 1234 10 12345 15
2) * ** *** **** *** ** *
3)WAP to print all possible combinations of any three digit number for eg.123 would be 123,132,231,,,,,,so on |
|
abhas Active member
| Subject: icse isc cbse java bluej program Wed Jun 11, 2008 3:55 pm | |
| second one is the easiest
class ques2 { void main(int n)//take n as parameter if want { for(int c=1;c<=n;c++) { for (int d=1;d<=c;d++) { System.out.print("*"); } System.out.println(" "); }
for(int e=n-1;e>=1;e--) { for (int f=1;f<=e;f++) { System.out.print("*"); } System.out.println(" "); } } }
i have tested it in blueJ it is working properly
//i will answer other ques. soon |
|
abhas Active member
| Subject: icse isc java bluej pattern question Sat Jun 14, 2008 10:34 am | |
| Ans. of ques. 1 this program will print 1 1 12 3 123 6 1234 10 12345 15
when you will give value of parameter n as 5 I have tested this program ... class ques1 { void main(int n) { int s=0; for(int c=1;c<=n;c++) { for (int d=1;d<=c;d++) { s=s+d; System.out.print(d); } System.out.print(" "+ s); s=0; System.out.println(" "); } } }
|
|
^snigdha^ Active member
| Subject: Re: plz help me Fri Apr 24, 2009 4:00 pm | |
| plz try out dis one 4 me......wap to calculate the area, perimeter & diagonal of a rectangle using 3 separate functions.....a nice & simple 1 plz... plz post the program asap... |
|
^snigdha^ Active member
| Subject: Re: plz help me Sun Apr 26, 2009 10:38 pm | |
| hey....is there no1 to help me?? |
|
Apurva Active member
| Subject: Re: plz help me Mon Apr 27, 2009 12:01 am | |
| ohk here's d program wid a biot of short forms for d long syntaxes import java.io.* class test { public static l,b; public static void area { int c; c=l*b; System.out.println("area is "+c); } public static void perimeter { int p; p=2*(l+b); System.out.println("perimeter is "+p); } public static void diagonal { float d; d=math.sqrt((l*l)+(b*b)); System.out.println("diagonal is "+d); } public static void main (String args[])throws IOException { ISR read=new ISR(System.in); BR in=new BR(read); int l,b; System.out.println("enter l n b"); l=Integer.parseInt (in.readLine()); b=Integer.parseInt(in.readLine()); area(); perimeter(); diagonal(); }} thats done |
|
^snigdha^ Active member
| Subject: Re: plz help me Wed Apr 29, 2009 2:23 pm | |
| thnx apurva!!... |
|
Apurva Active member
| Subject: Re: plz help me Wed Apr 29, 2009 6:34 pm | |
| ur welcum dear |
|