Write a program that takes input from the user for marks of five subjects, calculates the percentage, and prints the grade based on the following criteria: 90% and above: A+ 80%-89%: A 70%-79%: B 60%-69%: C Below 60%: Fail
#include <stdio.h> int main() { float marks[5], total = 0, percentage; char grade; // Taking input for marks printf(“Enter marks for five subjects:\n”); for (int i = 0; i < 5; i++) { printf(“Subject %d: “, i + 1); scanf(“%f”, &marks[i]); total += marks[i]; // Adding marks to total } // Calculating percentage percentage = … Read more