Write a program using if else and logical operators to determine a student's grade. inwill surely give you brainlist.
Answers
Explanation:
public class IfElseDemo {
public static void main(String[] args) {
int testscore = 76;
char grade;
if (testscore >= 90) {
grade = 'A';
} else if (testscore >= 80) {
grade = 'B';
} else if (testscore >= 70) {
grade = 'C';
} else if (testscore >= 60) {
grade = 'D';
} else {
grade = 'F';
}
System.out.println("Grade = " + grade);
}
}
Answer:
#include<stdio.h>
int main(){
int mark;
scanf("%d",&mark);
printf("Your grade is ");
if(mark>90)
printf("A");
else if(mark<=90 && mark>80)
printf("B");
else if(mark<=80 && mark>70)
printf("C");
else if(mark<=70 && mark>60)
printf("D");
else if(mark<=60 && mark>50)
printf("E");
else
printf("F");
}
Explanation:
Hope it is helpful
please mark me as brainliest!