// format = condition ? expression1 : expression2;
#include <iostream>
#include <string>
using namespace std;
int main() {
double marks;
// take input from users
cout << "Enter your marks: ";
cin >> marks;
// ternary operator checks if
// marks is greater than 40
string result = (marks >= 40) ? "passed" : "failed";
cout << "You " << result << " the exam.";
return 0;
}