Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
can't do the descending order of a prime number.

What I have tried:

yes i have tried ..i am an amature and i am trying to learn coding but i am stuck at how to do this.
Posted
Updated 10-Sep-20 5:31am

Write a function for the primality test (did you Google for that?[^]) and call it in a loop from 3577 down-to 3479.
 
Share this answer
 
Well, if the descending order is the problem just do it in ascending order, store the results, and print them in reverse when complete (or reverse them and then print).

This isn't complicated: if you can identify any value as prime / not prime (and there are a lot of ways to do that) then the order isn't a problem - you can always reorder results when you have them even if you can't figure out how to calculated them in a different order (which is also pretty simple to do if you think about it).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900