C++ program to calculate students marks and grades. Find a student’s grade based on their performance in five subjects. Using a user-defined function, determine a student‘s grade based on marks earned in all subjects. The user can enter an unlimited number of subjects here.
A floating-point value is expressed as a mantissa plus an exponent or as a whole plus fractional digits (like decimal values). Float8 and double precision are synonyms for float. Four or eight bytes are used to store floating-point integers. Eight-byte integers are internally rounded to fifteen decimal digits.
using namespace std;
int marks, i;
cout<<"\n Enter the students marks\n";
cout<<"\n Total marks of student"<<sum;
cout<<"\n Average = "<<avg;
cout<<"\n Grade = ";
else if(avg>60 && avg<=80)
else if(avg>40 && avg<=60)
Enter the student’s marks
Total marks of student376
Average = 75.2
Grade = B
What is purpose of namespace in c++
You may specify the context in which names are defined by using namespace. A namespace, in essence, establishes a scope. C++ includes a standard library that contains common features like containers and algorithms that you’ll utilise in your programmes.