Computer Science, asked by debanganasaha6, 6 months ago


WAP to accept a word and display all the characters in
seperate lines​

Answers

Answered by anindyaadhikari13
3

Question:-

Write a program to accept a word and display all the characters in separate lines.

Program:-

import java.util.*;

class Word

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.print("Enter a word: ");

String s=sc.nextInt();

for(int i=0;i<s.length();i++)

System.out.println(s.charAt(i));

}

}

Answered by rohitkhajuria90
1

Please refer the attached image

Attachments:
Similar questions