DEV Community

hema latha
hema latha

Posted on

For loop basic

package Forloopbase;

public class Forloop {

public static void main(String[] args) {
    // TODO Auto-generated method stub
for(int line = 1; line<=5; line++)
{
    for(int col=1; col<=5; col++)
        {System.out.print(" * ");}
    System.out.println();

}  }}
Enter fullscreen mode Exit fullscreen mode

out put -






Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs