Array and Strings – Strings – Problem #9

IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive

Difficulty: medium

Problem Statement

Write a C program to calculate the relative grades of 10 students. The steps to calculate the grade are given as follows: (a) Take the marks of the 10 students in an array marks[]. The maximum and minimum marks are 100 and 0 respectively. If the entered marks are outside the range, then error should be displayed, and the system will wait till you enter the marks within the range. (b) Calculate the average (μ) of the marks (c) Calculate the standard (σ) deviation of the marks (d) Hence calculate the relative grades of the marks using the category: 10 if the mark is above (μ + 1.5*σ) 9 if the mark is above (μ + 1.0*σ) 8 if the mark is above (μ + 0.5*σ) 7 if the mark is above (μ) 6 if the mark is above (μ - 0.5*σ) 5 if the mark is above (μ - 1.0*σ) 4 if the mark is above (μ - 1.5*σ) Your input should be the marks of 10 students within an array and your output should be the grades of each of the students based on the marks that you have inputted. You may print the grade of each student in a new line and additionally make the output more readable, for example, Grade of Student 1 = 9 Grade of Student 2 = 10 Grade of Student 3 = 7 and likewise. . . . . . .

Back to Lab Problems
Array and Strings/Strings/Problem #9

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #9

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.