In this code if we enter the prime numbers like 3,5 or 7 the output is wrong.and if we input 3,11or 17.. output is correct why????

Recommended Answers

All 2 Replies

If you input 3 is the output wrong or right - you say both!
11 and 17 are also prime numbers

As are 5 and 7 (primes). Post your code please. RSA algorithms are covered thoroughly in a lot of open source documents and code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.