Question: i need this for school. I am a beginner in coding. I found a way to loop input values until the user inputs number 0. After that the program should display amount of pos,neg,even and odd numbers. If anyone can help me, I've been stuck googling and trying myself for the past 3 hrs.

```
int main()
{
    int positive, negative, even, odd, i, number,num;
    int counteven = 0, countodd = 0, countneg = 0, countpos = 0;

    printf("Hello!\n");                  
    printf("I am a programm that will tell you how many\npositive, negative, even and odd numbers you have inputted.\n");
    printf("You can start inputting numbers. When you're finished input the number 0 to let me know you're done.\n");

    int loop = ( 1 == scanf("%di",&number) ) && ( 0 != number );
    while( loop )
    {
        loop = ( 1 == scanf("%di",&number) ) && ( 0 != number );
    }

     if (number < 0)
    {
        countneg++;
    }
    else
    {
        countpos++;
    }

    printf("\nPositive Numbers : %d\nNegative Numbers : %d\nEven Numbers : %d\nOdd Numbers : %d", countpos, countneg, counteven, countodd);

        return 0;
}

```

Answer: 
I have found few problems in your code.

1. what is the purpose of putting **i** into `%d`. That code section must be look like this

```
( 1 == scanf("%d",&number) ) && ( 0 != number )
               ^

```

2. Don't assign comparisons into variables. It's lead to wrong outputs.

**wrong**

```
    int loop = ( 1 == scanf("%di",&number) ) && ( 0 != number );
    while( loop )
    {
        //code
    }

```

**Right**

```
    while(( 1 == scanf("%d",&number) ) && ( 0 != number ))
    {
        //code
    }

```

3. If you want to calculate something continuously, put that calculations in a **loop**. @Blaze have mentioned that.

```
    while(( 1 == scanf("%d",&number) ) && ( 0 != number ))
    {
        if (number < 0)
            countneg++;
        else
            countpos++;

        if (number % 2 == 0)
            counteven++;
        else
            countodd++;        
    }

```

4. Last thing is you have used lot of unused variable. If you don't use it remove those

```
 int number, counteven = 0, countodd = 0, countneg = 0, countpos = 0;

```
mod(%) operator is used the check the remainder

```
#include<stdio.h>

int main() {

    int positive, negative, even, odd, i, number,num;
    int counteven = 0, countodd = 0, countneg = 0, countpos = 0;

    printf("Hello!\n");                  
    printf("I am a programm that will tell you how many\npositive, negative, even and odd numbers you have inputted.\n");
    printf("You can start inputting numbers. When you're finished input the number 0 to let me know you're done.\n");

    i = scanf("%d",&number);

    while(number!=0 && i==1)
    {
       if (number < 0)
          countneg++;
       else
          countpos++;

       if(number%2==0) 
          counteven++;
       else            
          countodd++;

       i = scanf("%d",&number);

    }

    printf("\nPositive Numbers : %d\nNegative Numbers : %d\nEven Numbers : %d\nOdd Numbers : %d", countpos, countneg, counteven, countodd);

    return 0;
}

```