Computer Science, asked by pravu72, 1 year ago

Write a program to accept your name 10 times?
(Do in scanner class)

Answers

Answered by rivnamaggarwal
1

class Name

{

public static void main(String []args)

{

System.out.println("Aanchal"+"Aanchal"+"Aanchal"+"Aanchal"+"Aanchal"+"Aanchal"+"Aanchal"+"Aanchal"+"Aanchal"+"Aanchal");

}

}


NOTE: Instead of "Aanchal",you can write your own name.Hope it helps you...


Answered by Anonymous
1

CODE :


import java.util.*;

class name_ten_times

{

public static void main(String args[ ])

{

Scanner sc=new Scanner(System.in);

String a[]=new String[10];

for(int i=1;i<=10;i++)

{

System.out.println("Enter your name 10 times");

a[i]=sc.nextLine();//accepting input

}//end of for-loop

}//end of main

}//end of class


Hope it helps !

______________________________________________________________

Similar questions