Created
July 22, 2022 15:12
-
-
Save SmashedFrenzy16/2f44bf520ebfcc78be54394218e87a10 to your computer and use it in GitHub Desktop.
A program that doubles each number in an array. This was made in D.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() | |
{ | |
import std.stdio : writeln; | |
int[] arr = [1, 6, 23, 678, 212, 5, 96, 52]; | |
int i = 0; | |
while (i < arr) | |
{ | |
arr[i++] *= 2; | |
} | |
writeln(arr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment