Question 2

You do not have access for this page.


To access this page please purchase:
TCS Ninja Coding Questions Products
TCS Ninja Online Live Classes


Note:- Please purchase the products mentioned above to get access to the page. Also, if you have any queries related to product purchase drop a message on our Facebook page.

Please Login/Signup to comment

One comment on “Question 2”


  • Diptam Bhowmik

    import java.util.*;
    public class Main
    {
    public static void main(String[] args) {
    Scanner can = new Scanner(System.in);
    String originalstring=””,reversestring=””;int l;
    originalstring=can.next();
    l=originalstring.length();
    for(int i=l-1;i>=0;i–)
    {
    char ch=originalstring.charAt(i);
    reversestring=reversestring+ch;
    }
    System.out.println(reversestring);
    }
    }