Write a Powershell Script to get this output ?
1 is not even
4 3 is not even
8 5 is not even
12 7 is not even
16 9 is not even
20
The following example uses the return
keyword to exit a function at a specific point if a conditional is met. Odd numbers are not multiplied because the return statement exits before that statement can execute.
function MultiplyEven
{ param($number) if ($number % 2) { return "$number is not even" } $number * 2
} 1..10 | ForEach-Object {MultiplyEven -Number $_}
1 is not even
4
3 is not even
8
5 is not even
12
7 is not even
16
9 is not even
20
Write a Powershell Script to get this output ?
1 is not even
4 3 is not even
8 5 is not even
12 7 is not even
16 9 is not even
20
The following example uses the return
keyword to exit a function at a specific point if a conditional is met. Odd numbers are not multiplied because the return statement exits before that statement can execute.
function MultiplyEven
{ param($number) if ($number % 2) { return "$number is not even" } $number * 2
} 1..10 | ForEach-Object {MultiplyEven -Number $_}
1 is not even
4
3 is not even
8
5 is not even
12
7 is not even
16
9 is not even
20
status | not learned | measured difficulty | 37% [default] | last interval [days] | |||
---|---|---|---|---|---|---|---|
repetition number in this series | 0 | memorised on | scheduled repetition | ||||
scheduled repetition interval | last repetition or drill |