2:23 pm - Thursday November 15, 2018

Java Example Program to calculate grade using Switch Case

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
@author:candidjava.com
@description:Program to calculate grade using Switch Case
*/
public class Findgrade {
	public static void main(String org[]) {
		int i = 2;// given input grade
		switch (i) {
		case 1:
			System.out.println("1st grade");
			break;
		case 2:
			System.out.println("2nd grade");
			break;
		case 3:
			System.out.println("3rd grade");
			break;
		default:
			System.out.println("none");
		}
	}
}

output:

2nd grade

Filed in: Sample Programs in java

Comments are closed.