CBSE BOARD XII, asked by mehakparekh, 8 months ago

write a program to generate a series of marks of 10 students.
give grace upto 5 students of those who are having<33 marks and print w new list of marks.​

Answers

Answered by sureshiyshsri
4

Answer:

hope this helps.please mark this question as brainliest. please

Explanation:

// CPP program to assign grades to a student

// using nested if-else

#include<bits/stdc++.h>

using namespace std;

int main()

{

// Store marks of all the subjects in an array

int marks[] = { 25, 65, 46, 98, 78, 65 };

// Max marks will be 100 * number of subjects

int len = sizeof(marks) / sizeof(marks[0]);

int max_marks = len * 100;

// Initialize student's total marks to 0

int total = 0;

// Initialize student's grade marks to F

char grade = 'F';

// Traverse though the marks array to find the sum.

for (int i = 0; i < len; i++)

{

total += marks[i];

}

// Calculate the percentage.

// Since all the marks are integer,

// typecast the calculation to double.

double percentage = ((double)(total) / max_marks) * 100;

// Nested if else

if (percentage >= 90)

{

grade = 'A';

}

else

{

if (percentage >= 80 && percentage <= 89)

{

grade = 'B';

}

else

{

if (percentage >= 60 && percentage <= 79)

{

grade = 'C';

}

else

{

if (percentage >= 33 && percentage <= 59)

{

grade = 'D';

}

else

{

grade = 'F';

}

}

}

}

cout << (grade) << endl;;

}

// This code is contributed by

// Surendra_Gangwar

Answered by shresthakamala56
1

Answer:

Mark as brainliest!!!

Explanation:

Enter information of students:  

For roll number1,

Enter name: Tom

Enter marks: 98

For roll number2,

Enter name: Jerry

Enter marks: 89

.

.

.

Displaying Information:

Roll number: 1

Name: Tom

Marks: 98

.

Similar questions