Card Game - IX

Johnny started to play next card game-IX. In this game, Johnny has to pick one card. The number present in the card will determine whether he will be a winner or not. If the number is a perfect number, then Johnny is a winner. Johnny was confused about what is the perfect number.The manager explains to him that a number is said to be a perfect number if the number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself.
Example,28 is perfect numberDivisors of 28 = {1,2,4,7,14}.The sum of all divisors = 28
Can you please help Johnny to win this game using while loop?
Input Format:Input consists of a single integer.
Output Format:The output consists of a single line. Refer sample output for details.
[All text in bold corresponds to the input and the rest corresponds to output]
Sample Input and Output 1:Enter the card picked up by Johnny:28Johnny will win the Card Game
Sample Input and Output 2:Enter the card picked up by Johnny:15Johnny will not win the Card Game


Program Code:#include  int main(){    int number, rem, sum = 0, i;    printf("Enter the card picked up by Johnny:\n");    scanf("%d", &number);    i=1;    while(i <= (number - 1))    {        rem = number % i; if (rem == 0)        {            sum = sum + i;        }    i++;      }    if (sum == number)        printf("Johnny will win the Card Game");    else        printf("Johnny will not win the Card Game");    return 0;}