Hi, I am trying to write a program that shows whether a year is a leap or not and if it is what the sum of those digits are : I understand the line of code that is used to determine if something is a leap year or not and I've seen the line of code to determine the sum of numbers but I don't know how to combine the two. When I run it I get an error saying 
"In function amaina:
error. aelsea without a previous aifa
error. aelsea without a previous aifa"

    #include <stdio.h>
       int main()
    {
       int year,sum=0,r;
    ;
    printf("Enter a year to check if it is a leap year\n");
    scanf("%d", &year);
     if ( year%400 == 0)
    for(;year!=0;year=year/10){
    r=year%10;
	sum=sum+r;
    }
    printf("%d is a leap year and the sum is %d.\n", year,sum);
    else if ( year%100 == 0)
    printf("%d is not a leap year.\n", year);
    else if ( year%4 == 0 )
		for(;year!=0;year=year/10){
	r=year%10;
	sum=sum+r;
    }
    printf("%d is a leap year and the sum is %d.\n", year,sum);
    else
    printf("%d is not a leap year.\n", year);  
    return 0;
    }