+ 2
Write an if-else statement that output the word passed provided the value of the variable exam is greater than or equal to 60
3 Réponses
+ 2
language?
Python:
return "Passed" if exam >= 60 else "Failed"
JavaScript:
return (exam >= 60) ? "Passed" : "Failed"
0
if (exam>=60)
{
Console.WriteLine("Passsed");
}
else
{
Console.WriteLine("Not passed");
}
0
Write an if-else statement that outputs the word Passed provided the value of the variable exam is greater than or equal to 60 and also the value of the variable programsDone is greater than or equal to 10. Otherwise, the if-else statement outputs the word Failed. The variables exam and programsDone are both of type int.