Computer Science, asked by MasterQuestioner, 1 year ago

Write a program to display the names of five fruits
with a single System.out.println(); statement, but in different
lines.

Answers

Answered by duragpalsingh
59

Hey there!

Program to display the names of five fruits  with a single System.out.println(); statement, but in different  lines.

public class Question2  

{     static void main()  

  {         System.out.println("Apple\nOrange\nGuava\nMango\nGrapes");    

 } }  

Hope It helps You!

Answered by Anonymous
47

public class fruits

{

public static void main(String args[])

{

System.out.println("Mango\n"+"Apple\n"+"Banana\n"+"Grapes\n"+"Orange\n");

}

}

Similar questions