Write a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRYWrite a program to input a sentence and convert it into uppercase and display each word in a separate line.
Example: Input : “India is my country”
Output : INDIA
IS
MY
COUNTRY
Answers
Explanation:
answer answer Bata dijiye bhai iska
Here is your answer mate........
Answer:
INDIA
IS
MY
COUNTRY
Explanation:
import java.util.Scanner;
class program{
public void ps()
{
String a;
String b;
int len;
int i;
char c;
Scanner sc = new Scanner(System.in);
System.out.print("Enter a String: ");
a = sc.nextLine();
b = a.toUpperCase();
len = b.length();
for (i=0;i<len;i++)
{
c = b.charAt(i);
if (c == ' ')
{
System.out.print("\n");
}
else{
System.out.print(c);
}
}
}
public static void main()
{
program obj = new program();
obj.ps();
}
}
Hope it helps......
Pls Mark it as Brainliest........