1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include<stdio.h> main() { int num,sum,a,b,c,d,e,d1,d2,d3,d4,d5; printf("Enter any five digits number:"); scanf("%d",&num); a=num/10; d5=num%10; b=a/10; d4=a%10; c=b/10; d3=b%10; d=c/10; d2=c%10; e=d/10; d1=d%10; sum=d1+d2+d3+d4+d5; printf("\nsum of digis of given number is %d",sum); } |
Subscribe to:
Post Comments
(
Atom
)
Post a Comment