Array in java using assignment for characters

//using assignment for character
class ex_2
{
    public static void main(String[]args)
    {
        int i;
        char ch[]={'I','N','D','I','A'};
        for(i=0;i<5;i++)
        System.out.println(ch[i]);
    }
}

output

I
N
D
I
A

No comments:

Post a Comment

any problem in any program comment:-

Second largest number in java using ternary operator

 //Largest second number using ternary operator public class Main { public static void main(String[] args) { int a=5,b=6,c=7; int ...