Wednesday, 11 November 2020

Write a Program in Java to print the letters from A to Z along with their numeric values from 1 to 26 respectively.

public class Letters

{

public static void main(String[] args) 

{

    int i,val;

    for(i=65,val=1;i<=90;i++,val++)

    System.out.println((char)i+"\t"+val);

}

}


No comments:

Post a Comment

Java Program to count the total number of characters in a string

 //Java Program to count the total number of characters in a string import java.util.*; public class CountChars {     public static void mai...