Solid rectangle with small alphabets pattern 2 in java.
import java.util.*;
class Pattern {
public static void main(String[] args)
{
Scanner sc= new Scanner(System.in);
System.out.println("enter the n and m=");
int n=sc.nextInt();
int m=sc.nextInt();
for(int i=1; i<=n; i++){
for(int j=1; j<= m; j++){
System.out.print((char)(i+96)+" ");
}
System.out.println();
}
}
}
■》 Output->
enter the n and m=
4
8
a a a a a a a a
b b b b b b b b
c c c c c c c c c
d d d d d d d d
■》 Code link -> click 👇👇👇👇
https://www.programiz.com/online-compiler/3SqnrGPkv6bIj
Comments
Post a Comment