#include<stdio.h> 
#define STUDENTS 20                      /*  20 student */ 
int 
main() 
{ 
        double test1,test2, test3, final; 
        int student_num=1;
		double calculate_average;
		int n,i,sum=0;
         
        while(student_num <= STUDENTS)          /* you could simply put "student_num <= 20" */ 
        { 
                        printf("enter the score for student %d\n",student_num); 
         
                        printf("enter the score in test 1>> "); 
                        scanf("%lf",&test1); 
                        printf("enter the score in test 2>> ");
                        scanf("%lf",&test2); 
                        printf("enter the score in test 3>> "); 
                        scanf("%lf",&test3); 
                        printf("enter the score in final>> "); 
                        scanf("%lf",&final); 
                        printf("\n\n"); 
                         
         
                        if (test1<0 || test1>25 || test2<0 || test2>25 || test3<0 || test3>25 || final<0 || final>50 ) 
                        { 
                    printf("invaled value\n"); 
         
                    printf("enter the score again\n"); 
                    printf("enter the score for student %d\n",student_num); 
         
                    printf("enter the score in test 1>> "); 
                    scanf("%lf",&test1); 
                    printf("enter the score in test 2>> "); 
                    scanf("%lf",&test2); 
                    printf("enter the score in test 3>> "); 
                    scanf("%lf",&test3); 
                    printf("enter the score in final>> "); 
                    scanf("%lf",&final); 
                    printf("\n\n");

					printf("test 1 , test 2 , test 3 , final:\n");
                    printf("%lf     , %lf    , %lf    , %lf  :\n",&test1 , &test2 , &test3 , &final);
  
                    sum = test1+test2+test3+final;
                    calculate_average = sum/4;
                    printf("The sum is :%d\n",sum);
                    printf("The average is :%f\n",calculate_average);

				   
				   
             } 
 
                   else  
                           printf("go to next student"); 
                            
                         student_num=student_num+1; 
 
        }
         
 
        return (0); 
 

}



