Computer Science, asked by hardiknagariyadpschh, 11 months ago

This questinon is of java

Attachments:

Answers

Answered by amannishad0512p5zxh6
0

import java.util.*;

class Grade

    {

          public static void main()

       {

             Scanner sc=new Scanner(System.in);

int i,j,marks;

int  subject[]=new int[3];

for(i=0;i<subject.length;i++)

{

  System.out.println("Enter the marks of subject "+(i+1));

    subject[i]=sc.nextInt();

}

i=1;

for( j=0;j<subject.length;j++)

{

    marks=subject[j];

  if(marks>70)

  {

     System.out.println("Grade of subject "+j +"is"+"A");

  }

else if(marks>=50 && marks<=70)

  {

     System.out.println("Grade of subject "+j +"is"+"B");

  }

else if(marks<50)

{

System.out.println("Grade of subject "+j+"is"+"C");

}

i++;

}

  }

}

Mark me brainlest @

And follow me for java programming @    

     

         


amannishad0512p5zxh6: Mark me brainlest @
amannishad0512p5zxh6: If you have a doubt ,ask me again
amannishad0512p5zxh6: Run this program on BLUEJ .
amannishad0512p5zxh6: and ask if you have a doubt
Similar questions