online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import sympy # Given values n = 391 e = 291 # Step 1: Factorize n to find p and q factors = sympy.factorint(n) p, q = factors.keys() # Step 2: Calculate φ(n) = (p - 1) * (q - 1) phi_n = (p - 1) * (q - 1) # Step 3: Find the modular inverse of e modulo φ(n) to get d d = sympy.mod_inverse(e, phi_n) # Print the results print(f"Factors of n: p = {p}, q = {q}") print(f"φ(n) = {phi_n}") print(f"Private key d = {d}")

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue