Computer Science, asked by xxxse, 1 year ago

Write a program in java to display message 'Happy new Year' ten times on the screen.

Answers

Answered by Anonymous
15

//To display a message on the screen

public class Message

{

public static void main(String args[])

{

int a;

for(a=1;a<=10;a++)

System.out.println("Happy New Year!!!");

}

}

Answered by SmritiSami
1

The java program to display the message 'Happy new Year' ten times on the screen is as follows:

INPUT:

1. public class HelloWorld {  

2.            public static void main(String[ ] args) {  

3.                  for (int i = 0; i < 10; i++) {  

4.                    System.out.println("Happy New Year");  

5.                        }  

6.              }  

7.  

8. }

OUTPUT:

Happy New Year

Happy New Year

Happy New Year

Happy New Year

Happy New Year

Happy New Year

Happy New Year

Happy New Year

Happy New Year

Happy New Year

Similar questions