38: Write a ternary program to show that if your marks are lower than 33%, you fail. Otherwise you pass
// Write a ternary program to show that if your marks are lower than 33%, you fail. Otherwise you pass
#include <iostream>
using namespace std;
int main()
{
float marks, total, percent;
cout << "Enter your obtain marks: ";
cin >> marks;
cout << "Enter your total marks: ";
cin >> total;
percent = (marks / total) * 100;
percent >= 33 ? cout << "You Pass" : cout << "You fail";
return 0;
}
Comments
Post a Comment