Skip to content

Instantly share code, notes, and snippets.

@SmashedFrenzy16
Created July 22, 2022 15:12
Show Gist options
  • Save SmashedFrenzy16/2f44bf520ebfcc78be54394218e87a10 to your computer and use it in GitHub Desktop.
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.
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