subject

Assign to the variable boolean 'primesecond' the value true if the second leading (just after the most significant) decimal digit of the value of an int variable 'n' is 2,3,5 or 7; otherwise assign 'primesecond' the value false . assume 'primesecond' and 'n' are already declared and that 'n' has already been assigned a value . so if n's value is 58047 primesecond will be false because the second leading digit of 58047 is 8 which is not 2 or 3 or 5 or 7.so far i have: while (n > 1) {int n=((n%1)/1000)); if( (n==2)||(n==3) || (n==5)|| (n==7) ){primesecond=true; }else primesecond = false; }system. out. println(primesecond); this keeps giving me an error and saysctest. java: 7: error: '; ' expected int n=((n%1)/1000)); ^1 erroryou almost certainly should be using:

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, hailee232
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, kierafisher05
What is the most popular genre of video games?
Answers: 1
image
Computers and Technology, 23.06.2019 08:00, hernandez09297
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
image
Computers and Technology, 24.06.2019 10:10, juliana0122
Scanning the road can be thought of as a
Answers: 2
You know the right answer?
Assign to the variable boolean 'primesecond' the value true if the second leading (just after the mo...

Questions in other subjects:

Konu
Mathematics, 29.12.2021 23:40
Konu
Mathematics, 29.12.2021 23:40
Konu
Computers and Technology, 29.12.2021 23:40
Konu
Mathematics, 29.12.2021 23:40