This questinon is of java
Attachments:
Answers
Answered by
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 @
Similar questions