0
Convert Java program to Python program
Hello I am learning Java programming I know Python programming language very well. Could you please convert the Python program to java program . This the program for sum of digits . n="100" sum_of_digits=0 for i in range(len(n)): sum_of_digits+=int(n[i]) print(sum_of_digits)
7 RĂ©ponses
0
Yes đđąđąđđš đđĄđđČđđ„ I have tried .
0
I have tried this in java
class sample{
public static void main(String args[]){
String s="123";
int count=0;
for(int i=0;i<s.length();i++){
count+=Integer.parseInt(s.charAt(i));
}
}
}
0
Thank you đđąđąđđš đđĄđđČđđ„ but why you have used double quotes at line 7