adplus-dvertising
frame-decoration

Question

What is the output of the below Java program?
char ch[] = {'A', 'B', 'C'};
int i=0;
do
{
  System.out.print(ch[i] + ",");
  i++;
}while(i < ch.length);

a.

A,B,C,

b.

A,B,C

c.

A,A,A

d.

Compiler error

Posted under Java Programming

Answer: (a).A,B,C,

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the below Java program?