Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Liam mallka

Member
  • Content Count

    13
  • Joined

  • Last visited

Posts posted by Liam mallka

  1. <

    #include <stdio.h>
    #include <math.h>

    void math(int a, int b);

    int main()
    {
        int a, b;
        printf("Enter 2 numbers: ");
        scanf("%d %d", &a, &b);
        math(a, b);
        return 0; 
    }

    void math(int a,int b)
    {
        int i = 0;
        for (i = a; i >= b; i--)
        {
            if (i % b == 0)
            {
                printf("i = %d b = %d\n", i, b);
                printf("%d \n", i);
            }
        }
    }> 

     

    image.png.6f2db4eafacfd4587eab95655decbdf3.png

  2. Just now, Dat Guy said:

    You can use CODE blocks here. Screenshots are harder to debug for us.

     

    Anyway: What exactly requires our help? Looks like your code does what it should.

    idk how to do the first max and second max like the output says

  3. hey I need help with my code 

    I need to get that output 

    image.png.126062551dddf67addfe15b6d1acf785.png

    and I have no idea how to do the first max and second max so far I came up with this

    image.png.787240bffb2dfc662e54997d26be44e3.png

     

     

     

    image.png

  4. 10 hours ago, badreg said:

    You don't know how to check if an integer is less than zero? Or how to scan an integer from input?

    I know how to scan ab integer but im not sure how to check but I think that it goes like that "if (x < 0)

  5. 1 minute ago, James Evens said:

    Read the documentation on floating points variables/types. For this homework the part describing how a float works (especially how the negative values work)

     

    no documentation in my  question I only got this: Write program receiving an integer and prints the absolute value (absolute value).
    Do not use the abs command except for conditions only! Please note that in this question only one condition is sufficient.

  6. 2 minutes ago, Sauron said:

    You should check if the value is lower than zero and if it is just return the negative of that value.

    Im scanning the number from the client so I cant do that.

×