java 6 - I am getting ';' expected error,illegal start expression and else without if -
i want out put this-
150 can fitted in:
- short
- int
- long
150000 can fitted in:
- int
- long
1500000000 can fitted in:
- int
- long
213333333333333333333333333333333333 can't fitted anywhere.
-100000000000000 can fitted in:
long
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class solution {
public static void main(string[] args) { /* enter code here. read input stdin. print output stdout. class should named solution. */ byte b; long l; int t, v; int[] n; scanner in=new scanner(system.in); system.out.println("inter number"); v=in.nextint(); n=new int[v]; int i=0; while(n.hasnextint()) { n[i]=in.nextint(); i++; } for(int k=0;k<t;k++) {if(b<n[k]) { system.out.println(k+"this fit in"); system.out.println("*short"); system.out.println("*int"); system.out.println("*long");} else if(t==n[k]){ system.out.println(n[k]+"this fit in"); system.out.println("int"); system.out.println("long");} else if(t<=n[k]){ system.out.println(n[k]+"this fit in"); system.out.println("int"); system.out.println("long");} else if((t<=n[k])&&(l==n[k])){ system.out.println(n[k]+"this fit in"); system.out.println("long");} else{ system.out.println(n[k]+"this not fitted where");}}}}
a quick fix use ide eclipse or netbeans formats code , makes life far easier debug, develop in open-source , reduces development time. coming errors: can spot have missed } @ end of program script , notice syntactically wrong statement:
} else if (t <= n[k] > ) {
please confirm correct syntactically code , use formatting enable fellow developers you. luck!
Comments
Post a Comment