hi ,
anybody would help me how to print prime factors in c using recursive function

Here is the make-shift algorithm

  • Take the number to be worked upon from user. Call it NUM
  • Try to find a number from 1 to half of the NUM which divides NUM and leaves no remainder
  • If you find such a number, check whether the number is prime or not
  • If it is prime, print the number

Algorithm for prime

  • Take the number to be worked upon from user. Call it PRM
  • From 2 to half of PRM, take numbers and divide PRM with them.
  • If, on division, there is no remainder, signal that PRM is not prime
  • If, at the end of all such divisions, no divisor has been found, signal that PRM is prime

Try to convert this into 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.