1.

Write the program to display the result of student on marks obtained .

Answer»

#define SUBJECTS 6
#define PASSMARK  35
void main(int argc, char *argv[])
{
   int n = 0,  marks [SUBJECTS], failed=0;

      for  (n = 0; n < SUBJECTS ; n++ )    // read in marks for all subjects
          scanf("%d",& marks[n]);
      for  (n = 0; n < SUBJECTS ; n++ )   // check for pass in each subject
          if (marks[n] < PASSMARK)   failed++;
     // now check
     if (failed > 0) then
          printf("You have failed in %d number of subjects  :( , BETTER luck NEXT time \n", failed);
     ELSE
          printf("You have PASSED in all subjects! Congrats!  :) \n");

}



Discussion

No Comment Found