Hi,
If you want to take each number into separate variable, you can go with this.
main()
{
int i,j,k,l,m;
scanf("%1d%1d%1d%1d%1d",&i,&j,&k,&l,&m);
printf("%d",i+j+k+l+m);
}
give input as 12345
now it each digit is taken into new variable .
and the result would be the sum of all five vars(15 here).
If you give more than 5 digits, it will ignore remaining digits.