Chapter 2 - Expressions
-
Run an infinite
loop
to keep on printingHello, World!
.
hint:
you might want to usectrl+c
orctrl+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
oreven
respectively. -
Find and print factorial of a program using recursion.
-
Using a match statement to print
one
for input1
,two
for2
and so on, andNaN
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.