package com.codegym.task.task01.task0132;
/*
Sum of the digits of a three-digit number
*/
public class Solution {
public static void main(String[] args) {
System.out.println(sumDigitsInNumber(546));
}
public static int sumDigitsInNumber(int number) {
int a = 5;
int b = 4;
int c = 6;
int d = number%10;
int e = d + number;
return number / 10;
}
}
i do not understand no logic ..package com.codegym.task.task01.task0132;
/*
Sum of the digits of a three-digit number
*/
public class Solution {
public static void main(String[] args) {
System.out.println(sumDigitsInNumber(546));
}
public static int sumDigitsInNumber(int number) {
int a = 5;
int b = 4;
int c = 6;
int d = number%10;
int e = d + number;
return number / 10;
}
}