Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PassedOrFailed
- {
- class Program
- {
- static void Main(string[] args)
- {
- double score = double.Parse(Console.ReadLine());
- if (score >= 3)
- {
- Console.WriteLine("Passed!");
- }
- else
- {
- Console.WriteLine("Failed!");
- }
- }
- }
- }
- With ternary operatop:
- using System;
- namespace PassedOrFailed
- {
- class Program
- {
- static void Main(string[] args)
- {
- double score = double.Parse(Console.ReadLine());
- Console.WriteLine(score >= 3 ? "Passed!" : "Failed!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement