0
why error getting on this line invalid character. int actual_amt=(amt * 10)/100;
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amt = scanner.nextInt(); for(int i;i<=3;i++){ int actual_amt=(amt * 10)/100; amt=amt-actual_amt; }System.out.println(amt); } }
7 ответов
+ 3
I don't get any Invalid character error, the only thing I see here is that you have not initialized your index in the for loop but that's it.
+ 1
Maz There's actually " Error : invalid character '\u00a0' " error.
Probably copied code
+ 1
I think I had a similar problem a while ago. If you don't have a perfect integer from that equation, then you have a floating decimal.
You could change the int to float or double (remember to add decimals to your numbers) and see how that works.
0
Line 9 : provide an initial value to the variable "i"
Like -> for(int i = 0 ; i <= 3 ; i++)
0
dont no i write whole program by myself with different methods
still error invalid character.
0
AYESHA SULTANA rewrite the whole program without any nuisance characters lying around
0
/playground/program. java: error:
incompatible types:possible lossy conversation from double to int
int actual_amt=(amt *10)/100;
error 1