Factors - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Factors

Hi again...Hope someone can help with the coding for the highest number below 1000 which has the most fcators (then print it). Need to get it done for tomorrow afternoon. Thats all the program has to do and not include 1 and the number itself. Bit of a beginner and have struggled for weeks on it.

Thanx

Anton

P.s...the code i have done is on a previous message from yesterday

Comments

  • stephlstephl Posts: 422Member
    : Hi again...Hope someone can help with the coding for the highest number below 1000 which has the most fcators (then print it). Need to get it done for tomorrow afternoon. Thats all the program has to do and not include 1 and the number itself. Bit of a beginner and have struggled for weeks on it.
    :
    : Thanx
    :
    : Anton
    :
    : P.s...the code i have done is on a previous message from yesterday
    :
    Try this.
    [code]#include


    int main(void)
    {
    int x,y,count=0,i,n;

    for (x=2;x<1000;++x)
    {
    i=0;
    for (y=2;y<1000;++y)
    if (!(x%y)) ++i;
    if (i>count) {n=x;count=i;}
    }
    printf("%d
    ",n);
    return 0;
    }[/code]
    Steph
  • anton19822anton19822 Posts: 12Member
    Thanks steph.

    That should be a big help.


Sign In or Register to comment.