100% c prog to add digits of given number and display it
#include <stdio.h> void main() { int rem,numb,total=0; printf("\n enter a non-negative integer:"); scanf("%d",&numb); while(numb) { rem=numb%10; total=total+rem; numb=numb/10; } printf("\n sum of digits of given number =%d",total); } ఔట్పుట్ తెర మీద ఇలా.. enter a non-negative integer:218 sum of digits of given number=11 enter a non-negative integer:0 sum of digits of given number=0