#include"stdio.h" #include"conio.h" void main() { int i,n,a,sum=0,x; printf("Enter n Digit Number: "); scanf("%d",&n); x=n; for(i=1;i<=n;i++) { a=n%10; n=n/10; sum=sum+a; } sum=sum+n; printf("\nSum of %d numbers=%d",x,sum); getch(); }
Post a Comment
No comments:
Post a Comment