Untitled
unknown
plain_text
3 years ago
291 B
4
Indexable
#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; }
Editor is loading...