Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  123
Language: C/C++
Code:
#include <stdio.h>

int main()
{
    int num=0 , den=2 , ans=0 , sum=1;
   
    printf("hallo, please enter number");
    printf("\n");
    scanf("%d" , &num);
    while (num>0)
    {
    ans=num/den;
    while (den<ans && sum<=num)
    {
        
        ans=num/den;
        if(ans*den==num)
        {
            sum=sum+den+ans;
        }
        ++den;
    }
    if (sum==num)
    {
        printf("nthe number %d is balanced", sum);
    }
    else 
    {
       // printf("the number is not balanced");
    }
    num--;
    if(num%10000==0)
    {printf(".");}
    den=2;
    sum=1;
    }
    
    return 0;
}


          
          
Comments: