- 1

this code has an proplem I can't find what's the wrong!!(revers string )

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String text = scanner.nextLine(); char[] arr = text.toCharArray(); int tall=arr.lenght; char []rev=new char[tall]; for (int i=0;i=tall-1;i++); {for (int j=tall-1;j==0;j--); {rev[i]=arr[j]; } } for (int a=0;a=tall-1;a++);{ System.out.print (rev[a]); } //your code goes here } }

5th Apr 2022, 7:03 PM
laila saadalden
2 Answers
0
Learn when to use Semicolon (;) in Java. learn what single equal (=) do and what double equals (==) do and when to use both https://www.sololearn.com/Discuss/3012744/?ref=app
5th Apr 2022, 7:05 PM
AÍąJ
AÍąJ - avatar
0
Also, there is a typo in arr.length
5th Apr 2022, 7:26 PM
Lisa
Lisa - avatar