Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
291 B
1
Indexable
Never
#include <stdio.h>
#include <stdlib.h>
int fun (int);
int main (){
	int i;
	printf("enter a number:");
	scanf("%d",&i);
	printf("the sum of individual digits is:%d ",fun(i));
	}
int fun (int i){
	int a,b=0,c;
	while (i!=0)
	{
		a= i%10;
		b=b+a;
		i=i/10;
			}
	return b;
}