National University: Department of Computer Science CL 101 - ITC Lab-12 (Spring-2015) Learning Outcomes
National University: Department of Computer Science CL 101 - ITC Lab-12 (Spring-2015) Learning Outcomes
Instructions
Task-1:
A) Write a function Fibo that will print the N values of Fibonacci series. N will be global variable. This function
will not take any parameter and will not return anything.
I.e. N= 8 where N>2
Output = 0,1,1,2,3,5,8,13
B) Write a function Factorial that will take a number as parameter and print its factorial. i.e. Num = 5 Fac =
120. Function will not return number.
C) Write a function Zeros that will take a number as a parameter and return the number of zeros in this
number. Print the returned value in the main. i.e Num = 50005 , Zeros = 3
D) Write a function TableOf7 that will print the table of 7 and return sum of all numbers. This function will
not take any parameter.
National University
OF COMPUTER AND EMERGING SCIENCES CHINIOT-FAISLABAD CAMPUS
Task-2:
Task-3:
Write a program that will take Month as input and print the calendar for the month of 2015.
Your input will be 1 for January, 2 for Feb etc. You have to write a function getDays(month) to
get the number of days for this specific month. First month (January) will be start from
Thursday and it will end on Saturday so next month February will start from Sunday.
Hint: It is a very simple program so think simply (for use of % operator, /t)
Sample Program Run - 1:
National University
OF COMPUTER AND EMERGING SCIENCES CHINIOT-FAISLABAD CAMPUS