Computer Science, asked by hasanimdad, 1 year ago

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

Answers

Answered by dansi902
3
control flow statement
{
      public static void main(string arg[])
      { 
            int marks = 78
            if (marks > =60)
                system.out.printIn (" Your marks are " +marks+" and you are passed");
            else
                system.out.printIn ("Your marks are " +marks+"and you are failed");
      }
}

Anonymous: thx
Answered by kvnmurty
2
#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");

}

Similar questions