Monday, 24 January 2022

C program to enter student marks and find percentage and grade :-

A college has the following rules for the grading system:

 1. Below 25 – F

2. 25 to 45 – E

 3. 45 to 50 – D 

4. 50 to 60 – C 

5. 60 to 80 – B

 6. Above 80 – A

MAIN PROGRAM :-

#include <stdio.h>

int main()

{

  int a;

  printf("enter the student marks=");

  scanf("%d",&a);

  if(a<25)

  {

    printf("F");

  }

  else if(a>=25&&a<45)

  {

    printf("E");

  }

  else if(a>=45&&a<50)

  {

    printf("D");

  }

  else if(a>=50&&a<60)

  {

    printf("C");

  }

  else if(a>=60&&a<80)

  {

    printf("B");

  }

  else if(a>=80&&a<=100)

  {

    printf("A");

  }

  else

{

  printf("invalid marks");

}

  return 0;

}

INPUT :-




OUTPUT :-

                                                              



                                              --THANKS FOR VISITING THIS WEBSITE--

1 comment:

Infosys Process Executive Recruitment 2022 | Apply Now

  Infosys Process Executive Recruitment 2022 | Apply Now  Infosys Process Executive Recruitment 2022 |Infosys Recruitment 2022 | Work From H...