+ 1
Code is showing error that cannot find symbol String [] z
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner (System.in); String n = sc.nextLine(); int a = n.length(); String [] z = {A,a,B,b,C,c,D,d,E,e,F,f,g,G,H,h,I,i,J,j,K,k,L,l,M,m,N,n,O,o,P,p,Q,q,R,r,S,s,T,t,U,u,v,V,w,W,x,X,Y,y,Z,z}; int q =z.length; String c =""; String t=""; for(int i=a-1;i>=0;--i){ char b = n.charAt(i); c = c + b ; } for(int j=0;j=a-1;++j){ for(int i=0;i<=q-1;++i){ if (c.charAt(j)==z[i]){ t = t + c.charAt(j); } } } System.out.print(t); } }
5 Antworten
+ 4
You didnt used (☞゚ヮ゚)☞ " "
for example:-
String[] z={"A","a","B","c"..........};
thats why error is cannot find symbol.
+ 1
You are comparing charecter with strings. So it not works..
Make charecter array..
char z[] = {'A', 'a', 'B',.........} ;
+ 1
Tysm
0
Ya tysm
0
Also if condition is not working pls tell why