answersLogoWhite

0

# include <stdio.h> main()

{

int num,count,sum;

count=0;

sum=0;

printf("enter an integer :");

scanf("%d",&num);

printf("ur num is : %d \n",num);

while (num!=0)

{

count++;

sum+=num%10;

num/=10;

}

printf("sum of the digits is : %d",sum);

}

User Avatar

Wiki User

15y ago

What else can I help you with?