Write a program in Java to input any word and any integer and print it 25 times
using for loop).
Answers
/*
Project Type: Brainly Answer
Date Created: 22-02-2021
Date Edited Last Time: ---NIL---
Question Link: Write a program in Java to
input any word and any integer and print it 25 times.
Program Created By: atrs7391
Programming Language: Java
Language version (When program created or last edited): jdk-15.0.2
*/
package Brainly_Answers.Program;
import java.util.Scanner;
public class For_Loop {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter Word: ");
String str = sc.nextLine();
System.out.println("Enter Integer: ");
int n = sc.nextInt();
for (int i = 0; i < 25; i++) {
System.out.println(str);
System.out.println(n);
}
}
}
Answer:
public class Main {
public static void main(String[] args) {
for (int i = 0; i < 25; i++) {
System.out.println(i);
}
}
}