Computer Science, asked by arorasugandhi36, 6 months ago

Using the switch case statement, write a menu driven program to do the following :
To generate and print letters from A to Z and their Unicode
Letters Unicode
A 65
B 66
. .
. .
. .
Z 90​

Answers

Answered by alizaaly999
11

1). To generate and print Letters from A to Z and their Unicode

Letters Unicode

A 65

B 66

Z 90

2) Display the following pattern using iteration (looping) statement.

1

12

123

1234

12345

code:

import java.util.*;

class Question5 {

public static void main(String args[]) {

Scanner in = new Scanner(System.in);

System.out.println("Choose an Option :");

System.out.println("1. To generate and print Letters from A to Z and their Unicode");

System.out.println("2. Display a Number Pattern.");

int ch = in.nextInt();

switch(ch) {

case 1:

System.out.println("Letters\tUnicode");

for(int i=65;i<=90;i++) {

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

}

break;

case 2:

for(int i=1;i<=5;i++) {

for(int j=1;j<=i;j++) {

System.out.print(j);

}

System.out.println("\n");

}

}

}

}

please mark as brainliest

Similar questions