Computer Science, asked by Ronald11, 1 year ago

Write a java program to print your names 5 times.
USING DATA INPUTSTREAM

Answers

Answered by Krishh98
0

import java.io.*;

public class KeyboardReading1

{

public static void main(String args[]) throws IOException

{

DataInputStream dis = new DataInputStream(System.in);

System.out.println("Enter your name: ");

String str1 = dis.readLine();

for (int x =0; x <5; x++)

System.out.println("I know your name is " + str1);

dis.close();

}

}

Similar questions