Example of a program making finite but unknown repetitions.

#include <stdio.h>

int main(void)
{
int num, sum = 0, onum;

printf( "\nEnter number : " );
scanf( "%d", &num );

onum = num;

do
{
sum += (num % 10);
num /= 10;
}while(num > 0);

printf( "\nSum of Digits of %d = %d", onum, sum);

return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin