Please solve this JAVA program... (pattern)
Attachments:
QGP:
I can answer,but someone needs to delete this wrong answer first
Answers
Answered by
3
Hey There,
Note that these are the ASCII Values:
65 - A
66 - B
67 - C
68 - D
Here, the ch variable stores the ASCII Integer value.
Here's your code:
public class Pattern
{
public static void main(String[] args)
{
int ch = 65; //65 is the ASCII Value of "A"
for(int i=1;i<=4;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print((char)ch);
}
System.out.println();
ch++;
}
}
}
Hope it helps,
Purva
Brainly Community
Note that these are the ASCII Values:
65 - A
66 - B
67 - C
68 - D
Here, the ch variable stores the ASCII Integer value.
Here's your code:
public class Pattern
{
public static void main(String[] args)
{
int ch = 65; //65 is the ASCII Value of "A"
for(int i=1;i<=4;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print((char)ch);
}
System.out.println();
ch++;
}
}
}
Hope it helps,
Purva
Brainly Community
Similar questions