RahRah wrote: |
---|
explain This part if ( *min_element( mark, mark + exammarks ) >= 60 ) |
I'm guessing that you want to require that ALL marks are greater than or equal to 60.
Logically, this is equivalent to the MINIMUM mark being greater than or equal to 60.
*min_element( mark, mark + exammarks )
produces the minimum of mark[0], mark[1], ... , mark[exammarks-1]. See
http://www.cplusplus.com/reference/algorithm/min_element/
min_element can be used for any iterable array or container.
What you have just written:
1 2 3 4
|
if (mark[i]>=60&&mark[i]<=100)
cout<<"you have qualified for the BSc in computer science!"<<endl;
else
cout <<"you donot qualify for the BSC in computer science";
|
makes no sense because:
(a) You are at most considering one mark, not all 3.
(b) Variable i is not defined at this point, so the index is meaningless.
You can either:
(1) find the minimum mark by some method similar to that suggested; or
(2) determine whether any of the marks is below 60 in the same loop in which you read them in.
You haven't addressed the other points in my previous post. You have also added some completely unnecessary braces. Your indentation is all over the place.