/*
Declare multiple variables in for loop Example
This Java Example shows how to declare multiple variables in Java For loop using
declaration block.
*/
public class DeclaringMultipleVariablesInForLoopExample {
public static void main(String[] args) {
/*
* Multiple variables can be declared in declaration block of for loop.
*/
for(int i=0, j=1, k=2 ; i<5 ; i++)
System.out.println("I : " + i + ",j : "+ j + ", k : " + k);
/*
* Please note that the variables which are declared, should be of same type
* as in this example int.
*/
//THIS WILL NOT COMPILE
//for(int i=0, float j; i < 5; i++);
}
}
Bookmark/Search this post with:
can you help!??
how will i make a code producing an output like this:
*****
****
***
**
*
???
piramid code
I can help
can you please help me?
Could you give me the code of this output:
*
**
***
****
*****
******
*******
******
*****
****
***
**
*
Like so
second for loop will never
second for loop will never end
change it to
Code From Highest Number
Write a program that displays 3 integers then displays the highest number..
help please
how can i make an output like this?
3
4
6
9
13
18
24
help me plz??
how will i make a code producing an output like this:
*
**
***
****
*****
What is the code for this?
how can you make this? please i need to know.. thanks...
*********
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
*********
how can i do this?
0 + 0 = 0
1 + 2 = 3
2 + 4 = 6
3 + 6 = 9
4 + 8 = 12
5 + 10 = 15
6 + 12 = 18
7 + 14 = 21
8 + 16 = 24
9 + 18 = 27
solution to the above sequence addition
how to make a code showing this
*
*
*
*
*
please answer
how about making a diamond
1
2 2
3 3 3
4 4 4 4
3 3 3
2 2
1
What is the output for this??
######
#####
####
###
##
#
Thanks!!
What is the code that make output like below??
######
#####
####
###
##
#
Here is the solution
What is the code that make output like below??
************
***** ******
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
***** ******
************
help me
1
1 2
1 2 3
palindrome
how to produce this output?
Enter a string: abba
The reverse of the entered string is abba.
The entered strig is a palindrome
how to display tis
K
SADV
SDVSVD
XSDVSDFV
SD
SDFSDFGSDGH
FN FH
FMTH
GFHF
MHF
FY
F
FTT
YF
JYF
TY
FTY
how can i
How can I do this?
1
212
32123
4321234
543212345
65432123456
etc?
Need Help
I have to loop a program containing if statements, 3 times. a double has to be input by the user and the output has to show either POSITIVE, NEGATIVE or ZERO>
Please help
how i find given sis pseudo arithmetic series or not:2,5,6,8,9
pls give solution in java
Please help! How do I print this?
Using a for loop:
1 4 7 10 13 16 19 22 25 28 31 34 37 40
Should count to 40 by 3's. Thank you!!
pure amazement
you are amazing the way u pop out code
diamond..........
*
***
*****
*******
*****
***
*
Post new comment