Question: Write a function called count_prime. This function takes an integer as an input and will return the number of prime numbers whose values are
Write a function called count_prime. This function takes an integer as an input and will return the number of prime numbers whose values are less than the input integer. (Example) If the function takes 10 as an input, it counts the number of prime numbers whose values are less than 10. (i.e.) 2, 3, 5, 7 => it returns 4 If the function takes 20 as an input, it counts the number of prime numbers whose values are less than 20. (i.e.) 2, 3, 5, 7, 11, 13, 17, 19 => it returns 8 (Hint) The following is the signature of count_prime function: int count prime(int x) { } Activ
Step by Step Solution
3.32 Rating (158 Votes )
There are 3 Steps involved in it
Heres a C function called countprime that takes an integer x as input a... View full answer
Get step-by-step solutions from verified subject matter experts
