0% found this document useful (0 votes)
30 views1 page

Programming Exercise

Uploaded by

Rushabh Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views1 page

Programming Exercise

Uploaded by

Rushabh Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Rushabh shah

19bcp108

import java.util.Scanner;
public class reversestring {

public static void main(String[] args) {


// TODO Auto-generated method stub
char[] array1;
int i;
Scanner scan=new Scanner(System.in);
System.out.println("enter a string to reverse");
String str=scan.nextLine();
scan.close();
array1=str.toCharArray();
System.out.println("reverse of string:");
for(i=str.length()-1;i>=0;i--);{
System.out.println(array1[i]);

You might also like