Monday, April 24, 2023

Slip1 Q.1. Core Java: A) Write a ‘java’ program to display characters from ‘A’ to ‘Z’

  

import java.io.*;

class slip1

{

public static void main(String[] args) {

char ch;

for(ch = 'A'; ch <= 'Z';ch++)

System.out.println("the alphabets are :"+ch);

}

}


Output:

C:\Program Files\Java\jdk1.8.0_144\bin>javac slip1.java


C:\Program Files\Java\jdk1.8.0_144\bin>java slip1

the alphabets are :A

the alphabets are :B

the alphabets are :C

the alphabets are :D

the alphabets are :E

the alphabets are :F

the alphabets are :G

the alphabets are :H

the alphabets are :I

the alphabets are :J

the alphabets are :K

the alphabets are :L

the alphabets are :M

the alphabets are :N

the alphabets are :O

the alphabets are :P

the alphabets are :Q

the alphabets are :R

the alphabets are :S

the alphabets are :T

the alphabets are :U

the alphabets are :V

the alphabets are :W

the alphabets are :X

the alphabets are :Y

the alphabets are :Z

No comments:

Post a Comment