1. Write a program in C# Sharp to create a List of numbers and display the numbers greater than 80 as output.
Test Data :
The members of the List are :
55 200 740 76 230 482 95
Expected Output :
The numbers greater than 80 are :
200
740
230
482
95
using System;
using System.Collections.Generic;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
List<int> list = new List<int>() { 55, 200, 740, 76, 230, 482, 95 };
for (int i = 0; i < list.Count; i++)
if (list[i] > 80)
Console.WriteLine(list[i]);
}
}
}
Comments
Leave a comment