Untitled
user_0161571
plain_text
2 years ago
965 B
5
Indexable
Never
#include <iostream> #include <iomanip> using namespace std; float mark, biggest, smallest, b_mark, s_mark, total; int judges, counter; int main () { cout << "Enter the number of judges: "; cin >> judges; while (judges < 4 || judges > 8){ cout << "Invalid. Please enter a number between 4 to 8\n"; cin >> judges; } /* Mark for the judges */ biggest=0; smallest=10; if (judges == 4){ for (counter = 0; counter < 4; counter++){ cout << "Enter mark between 0.0 to 10.0: "; cin >> mark; if (biggest < mark){ biggest = mark; } if (smallest > mark){ smallest = mark; } total = total + mark; } cout << "The biggest mark is " << biggest << endl; cout << "The smallest mark is " << smallest << endl; cout << total; } }