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