EASY LEVEL (1–10)

  1. Print numbers from 1 to N

Problem:

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

Example:

Input:5
Output:
12345

  1. Print numbers from N to 1
Input:5
Output:
54321

  1. Print all even numbers up to N
Input:10
Output:
246810

  1. Print all odd numbers up to N
Input:10
Output:
13579

  1. Find sum from 1 to N
Input:5
Output:
15

  1. Print multiplication table of N