+ 1
':' expected how do i fix this please.
13 Respuestas
+ 2
Every statement in java end with ;
So add
num = num/2 ; 👈
And
return binary ; 👈
+ 1
Is this about "loan amount calculations? "
Formulae is incorrect..
amount = amount - amount*10/100;
// for 10%, if you need 90% , take 90
better to take new question....
0
Can you shown code?
Otherwise, add : as compiler expecting... 🙂
0
import java.util.Scanner;
//your code goes here
public class Converter{
public static String toBinary(int num){
String binary="";
while(num>0){
binary=(num%2)+binary;
num=num/2
}
return binary
}
}
public class Program {
public static void main(String[ ] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
System.out.print(Converter.toBinary(x));
}
}
0
Here sir
0
Thank you
0
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int amount = scanner.nextInt();
//your code goes here
for(int i=0; i<3 i++){
amount=(int)(amount * 90/100)
}
System.out.println(amount);
}
0
Thanks everyone
0
How past code
0
How about this
0
Write a phyton program that declare 2 variables (num1 and num2 ) with values 105 and 35 respectively
- 1
Sir
- 1
How about this?