Chapter 2 - Expressions

  • Run an infinite loop to keep on printing Hello, World!.
    hint: you might want to use ctrl+c or ctrl+z to exit the infinite loop.

  • Take a integer input from the user and print table for that integer using a loop.

  • Print the following pattern using loops.

         *
        ***
       *****
      *******
     *********
    
  • Check whether the input number is odd or even and print odd or even respectively.

  • Find and print factorial of a program using recursion.

  • Using a match statement to print one for input 1, two for 2 and so on, and NaN on default.

  • Create a diverging function for addition of 2 numbers.

  • Create a program to check for leap year.
    note: 1900 is not a leap year.

  • Write a function to swap 2 numbers.

  • Write a program to find prime numbers upto a number N

  • WAP to sort a list of numbers.

  • WAP to iterate over 2 vectors at once.
    hint: try using .zip method.