Monday, December 26, 2011
12:12 AM

C Program to Find Sum of digits of a Number Excluding First and Last Digits


 Program to Find Sum of a Number Excluding First and Last Digits





#include
void main(){int n,num,x,sum=0,count=0,a,last,first,multiple=1;printf("Enter a number: ");scanf("%d",&n);a=n;
//finding the sum of the digitswhile(n>0){x=n%10;sum=sum+x;n=n/10;count++;}

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.