Chapter 2 - Expressions
-
Run an infinite
loopto keep on printingHello, World!.
hint:you might want to usectrl+corctrl+zto exit the infinite loop. -
Take a
integerinput 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
oddorevenrespectively. -
Find and print factorial of a program using recursion.
-
Using a match statement to print
onefor input1,twofor2and so on, andNaNon 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.zipmethod.