C-amount of numbers that have x number of factors within a certain range -


Can someone give me some insight as I would go about creating a simple program in C when I Entering Number 16 (indicates the number of factors which is a definite integer), the program counts how many values ​​are going from 1-100000 which are actually 16 factors. I am just starting with C, please expand and use simple method instead.

I have done so far:

  #include & lt; Stdio.h & gt; Int main (zero) {int n, x = 1, y = 100000, factor, count; Printf (number of factors: \ n "); Scan F ("% d ", & amp; n); for (factor = 0; factor & lt; = 1; factor ++) {if (x% factor = = 0 & amp; y% factor == 0) {count ++;}} printf ("% d numbers between 1 and 100000 are included, which are exactly% d separators \ n", n, factor); return 0;} Write a function that gives the number of factors in a number, then calls the loop from 1 to 100,000 in that function. For each return that corresponds to the specified number, the count increases Then use the calculation Return. 


Comments