Write a program in java to display message 'Happy new Year' ten times on the screen.
Answers
Answered by
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
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
History,
6 months ago
Social Sciences,
6 months ago
Science,
1 year ago
Hindi,
1 year ago
English,
1 year ago