Computer Science, asked by PrakritiShreshtha, 10 months ago

Write a Java program to input a string print the length of the string and convert the string to uppercase and print the reverse of the string.
Please answer l will mark you as brainlist....

Answers

Answered by harshitkavita15
0

Answer:

package com.company;

import java.util.Scanner;

public class Main {

   public static void main(String[] args) {

// write your code here

       Scanner In = new Scanner(System.in);

       String input = In.next();

       System.out.println(input.length());

       System.out.println(input.toUpperCase());

       byte [] strAsByteArray = input.getBytes();

       byte [] result =

               new byte [strAsByteArray.length];

       

       

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

           result[i] =

                   strAsByteArray[strAsByteArray.length-i-1];

       System.out.println(new String(result));

   }

}

Explanation:

Warning !!!

String Should be one word

Attachments:
Similar questions