Editorial
Output in ascending order the first even natural numbers.
Algorithm implementation
Read the input value .
scanf("%d", &n);
Output the first even numbers.
for (i = 1; i <= n; i++) printf("%d ", 2 * i);
Java implementation
import java.util.*; class Main { public static void main(String[] args) { Scanner con = new Scanner(System.in); int n = con.nextInt(); for (int i = 1; i <= n; i++) System.out.print(2*i + " "); System.out.println(); con.close(); } }
Python implementation
n = int(input()) for i in range(1,n+1): print(2*i, end = " ") print()