Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views2 pages

Assignment 03

The document outlines a programming assignment for a course in Programming Fundamentals, consisting of five questions. Each question requires the design of a C++ program to perform specific tasks such as printing multiplication tables, displaying patterns, computing factorials, generating Fibonacci series, and creating a pyramid of Xs. The assignment emphasizes the use of various loop constructs including while loops, nested while loops, do while loops, and for loops.

Uploaded by

zain0130923
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)
6 views2 pages

Assignment 03

The document outlines a programming assignment for a course in Programming Fundamentals, consisting of five questions. Each question requires the design of a C++ program to perform specific tasks such as printing multiplication tables, displaying patterns, computing factorials, generating Fibonacci series, and creating a pyramid of Xs. The assignment emphasizes the use of various loop constructs including while loops, nested while loops, do while loops, and for loops.

Uploaded by

zain0130923
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/ 2

School of Systems and Technology

Programming Fundamentals

Assignment

Question 01:

Design a C++ program that prints the multiplication table of 2 using while loop.

Question 02:

Design a C++ program that displays the following pattern using Nested while loop.

1
12
123
1234
12345

Question 03:

The factorial of a nonnegative integer n is written n! (Pronounced “n factorial”) and is defined as


follows: n! = n · (n - 1) · (n - 2) · … · 1 (for values of n greater than or equal to 1) and n! = 1
(for n = 0).

For example, 5! = 5 · 4 · 3 · 2 · 1, which is 120.

Write a program that reads a nonnegative integer and computes and prints its factorial using do
while loop.

Question 04:

Create a program to generate the Fibonacci series using while loop.

The program should ask the user a limit (a number) till which Fibonacci series is to be calculated.
It should also count the total number of Fibonacci integers that are generated.

Example of Fibonacci series: 1 1 2 3 5 8 13 21 34 55……


Question 05:

Use for loops to construct a program that displays a pyramid of Xs on the screen. The pyramid
should look like this

Except that it should be 20 lines high, instead of the 5 lines shown here.

You might also like