0% found this document useful (0 votes)
34 views

National University: Department of Computer Science CL 101 - ITC Lab-12 (Spring-2015) Learning Outcomes

1. The document outlines tasks for a computer science lab assignment on functions and loops in C++. Students are instructed to write code to complete four tasks: a) Write functions to print the Fibonacci series, factorial of a number, and number of zeros in a number. b) Write a function to print and sum the table of 7. c) Write a program to print the calendar for a given month of 2015 by getting the number of days for that month from a separate function. Students are told to submit their code and output screenshots in a Word document.

Uploaded by

Muhammad Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

National University: Department of Computer Science CL 101 - ITC Lab-12 (Spring-2015) Learning Outcomes

1. The document outlines tasks for a computer science lab assignment on functions and loops in C++. Students are instructed to write code to complete four tasks: a) Write functions to print the Fibonacci series, factorial of a number, and number of zeros in a number. b) Write a function to print and sum the table of 7. c) Write a program to print the calendar for a given month of 2015 by getting the number of days for that month from a separate function. Students are told to submit their code and output screenshots in a Word document.

Uploaded by

Muhammad Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

National University

OF COMPUTER AND EMERGING SCIENCES CHINIOT-FAISLABAD CAMPUS

Department of Computer Science


CL 101 ITC Lab-12 (Spring-2015)
Learning outcomes

While loop, For loop


Functions

Instructions

First understand the problem and then start working on it.


All tasks should be submitted within the lab timing no late submission would be
accepted in any case.
Write C++ code for all the problems using MS Visual studio and submit them in a MS
Word document with output screen shots.

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

Sample Program Run - 2:

You might also like