Computer Science, asked by nitish3391, 1 year ago

Write a program in Java to accept a name and print it thrice.​

Answers

Answered by neelrambhia03
2

//Print name thrice

import java.util.*;

class Name

{

public static void main(String args[])

{

Scanner sc = new Scanner(System.in);

String s;

System.out.print("Enter your name\n");

s = sc.nextLine();

for(I=1;I<=3;I++)

System.out.println(s);

}

}

Hope this helps you.

Answered by saivenkatvemulapalli
1

Answer:

//Print name thrice

import java.util.*;

class Name

{

public static void main(String args[])

{

Scanner sc = new Scanner(System.in);

String s;

System.out.print("Enter your name\n");

s = sc.nextLine();

for(I=1;I<=3;I++)

System.out.println(s);

}

}

Read more on Brainly.in - https://brainly.in/question/12709162#readmore

Explanation:

Similar questions