Computer Science, asked by aditya27012004, 1 year ago

what does i and j represent in looping statements of Java programs ​

Answers

Answered by Anonymous
6

Answer:

i and j are nothing but loop variables . They are used to iterate the loops . In patterns the i loop refers to the rows and the j loop refers to the columns .

Explanation:

For the pattern one :

for( int i=1; i<=5;i++ )

{

for( int j=1 ; j<=i ;j++ )

{

System.out.print(5);

}

System.out.println();

}

Here the number of rows will be represented by i-loop . There will be 5 such rows . Now in each row , the printing will be done by the j-loop which represents each column .

Columns are vertical and rows horizontal .


Anonymous: bro inbox me
Anonymous: okay
aditya27012004: Thnx a lot
Anonymous: wello !
Similar questions