write a program in java
to display 20 times your school name along with your name and class
Answers
Answered by
3
Question:-
write a program in java to display 20 times your school name along with your name and class.
Program:-
Using loop, we can solve it easily.
class Name
{
public static void main(String[] s)
{
int i=1;
while(i++<=20)
{
System.out.println("My name is: Write your name. ");
System.out.println("My School name is: Write your school name. ");
System.out.println("My class is: Write your class. ");
}// closing of while loop
}// end of main()
}// end of class.
Answered by
3
Answer:
for(i=1;i<=20;i++)
{
System.out.println("name:your name");
System.out.println("School name:your school name");
System.out.println("Class:your class");
}
Similar questions