- 2

can anyone please help me to remove the R in the last obj file of this program

import java.util.Scanner; class Number3 { public int armstrong(int n) { int i; int num = n, cubeSum = 0; for (i = n ; i > 0 ;i % 10) cubeSum=cubeSum + n; n++; if (cubeSum == n) return 1; else return 0; } static void main (String args[]) { Scanner in = new Scanner(System.in); System.out.print("Enter Number: "); int num = in.nextInt(); Number obj = new Number(); int r = obj.armstrong(num); if (r == 1) System.out.println(num + " is an Armstrong number"); else System.out.println(num + " is not an Armstrong number"); } }

29th Apr 2021, 3:26 AM
Abhijeet Kumar
Abhijeet Kumar - avatar
1 ответ
0
Can u please post the question?
29th Apr 2021, 3:44 PM
kreddyt
kreddyt - avatar