Monday 23 March 2020

PRINTING A MESSAGE USING JAVA LANGUAGE

Q-5- Write a java program that stores your Regd. No and year of admission into two variables, and displays their values on the screen.
INPUT :
public class NCM {

public static void main(String[] args) {
// TODO Auto-generated method stub
 int Regd_no=1941012335;
 int year=2019;
 System.out.println("My Regd. No is "+ Regd_no +" and I have taken admission in B.Tech In " +year);
}

}

OUTPUT :
My Regd. No is 1941012335 and I have taken admission in B.Tech In 2019

No comments:

Post a Comment