EASY LEVEL (1–10)

  1. Print Numbers from 1 to N

Problem:

Given an integer N, print numbers from 1 to N using a for loop.

Input:

An integer N.

Output:

Numbers from 1 to N (space separated).

Example:

Input: 5

Output:

1 2 3 4 5

  1. Sum of First N Numbers

Problem:

Given N, compute the sum of numbers from 1 to N.

Input:

Integer N.

Output:

Single integer representing the sum.

Example: