Computer Science, asked by vermaameesha, 1 year ago

Help help help help help pls.
write a program that takes a number and checks if the given number is a 3 digit number or not.(java ) (use if to determine)

Answers

Answered by Anonymous
0

Answer:

Explanation:

First, given number (number)'s value is stored in another integer variable, originalNumber. This is because, we need to compare the values of final number and original number at the end.

Then, a while loop is used to loop through originalNumber until it is equal to 0.

On each iteration, the last digit of num is stored in remainder.

Then, remainder is powered by 3 (number of digits) using Math.pow() function and added to result.

Then, the last digit is removed from originalNumber after division by 10.

Finally, result and number are compared. If equal, it is an armstrong number. If not, it isn't.


vermaameesha: i want a program
Anonymous: sorry
prateek324: might mine one help you
Answered by prateek324
2

import java.util.*;

class digit

{

public static void main()

{

Scanner sc=new Scanner(System.in);

System.out.print("enter no.");

int a=sc.nextInt();

if (a>99)

System.out.print("three digit");

else

System.out.print("not 3digit");

}

}


prateek324: please mark brainly
vermaameesha: sure hard work is always praised dude
Similar questions