Program to accept marks of subject calculate percentage .If percentage is greater than 50 display result pass otherwise fail.

 void main()
     {
       int s1,s2,s3,s4,s5;
       float per;
       clrscr();
       printf("enter marks="\n);
        scanf("%d %d %d %d %d",&s1,&s2,&s3,&s4,&s5);
       
      sum=s1+s2+s3+s4+s5;
      
      per=sum/5;

       printf(avarage="%d",per);

        if(per>=50)
         {
    
          printf("\n result=pass");
         
          }
     
        else

        {
   
         printf("\n result=fail");

        }
        getch();
    }


  output:

         Enter marks =
                  70
                  60
                  50
                  40
                  60
        
         percentage= 56.00

          result=pass