Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


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

int main()
{
 int num = 0;
 int s = 0;
 int i = 0;
 printf("Please input the number: \n");
 scanf("%d", &num);
 while(num)
 {
  s += num%10;
  num = num/10;
  i++;
 }
 if (i != 11)
{
      printf("\n");
}
 printf("no.=%d,sum=%d\n",i, s );
 return 0;
}
          
          
          
          
          
          
Comments: