If Else statements

Programming Fundamentals DSA practice problem on Onlearn.

Difficulty: easy.

Topics: Understanding Conditional Statements in Programming, Conditional Statements, Input/Output Operations, Data Types, Range Checking, general programming, If-Else Statement, Control Flow, Code Quality.

Grade Assignment System Problem Statement You are tasked with developing a system to assign grades to students based on their marks. The grading criteria are as follows: Marks less than 25: Grade 'F' Marks from 25 to 44 (inclusive): Grade 'E' Marks from 45 to 49 (inclusive): Grade 'D' Marks from 50 to 59 (inclusive): Grade 'C' Marks from 60 to 69 (inclusive): Grade 'B' Marks 70 or higher: Grade 'A' Your program should take an integer representing the student's marks as input and output their corresponding grade. Additionally, if the marks entered are outside the valid range of 0 to 100, the program should output "Invalid marks". Input A single integer marks. Output A single character representing the grade ('A', 'B', 'C', 'D', 'E', 'F') or the string "Invalid marks". Constraints 0 <= marks <= 100 Sample Test Cases Sample Input 1: Sample Output 1: Sample Input 2: Sample Output 2: Sample Input 3: Sample Output 3: Sample Input 4: Sample Output 4: Sample Input 5: Sample Output 5: Difficulty Level Easy