Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int [] list = new int[] {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89};
- int [] newList = new int [11];
- for (int i = 0; i < 11; i++)
- {
- if (list[i] <= 5)
- {
- newList[i] = list[i];
- }
- }
- Console.Write("a= ");
- for (int i = 0; i < 11 ; i++)
- {
- if (newList[i] <= 5)
- {
- Console.Write(newList[i] + " ");
- }
- if ( i == 4)
- {
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement