Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

NATIONAL UNIVERSITY OF MODERN LANGUAGES RAWALPINDI

LAB #06
SUBJECT:

PROGRAMMING FUNDAMENTAL

Lab#6

Submitted by:

Raja Muhammad zeeshan zubair F23-33509

Submitted to:

Mam sehrish firdous


TASK#01
Write C++ program to calculate & print sum of natural numbers using for loop, while
loop, do-while loop.

Using For Loop:

RUNNING AND COMPILING:

By using while loop:


RUNNING AND COMPILING

By using do while loop:


RUNNING AND COMPILING

TASK#02
Write a program in C++ to check whether a number is prime or not using for loop, while
loop, do-while loop.

By using for loop:


RUNNING AND COMPILING

By using while loop:


RUNNING AND COMPILING

By using do while loops:


RUNNING AND COMPILING
TASK#03
Write C++ program to generate multiplication of table using for, while & dowhile loop By

using for loop:

RUNNING AND COMPLILING


By using while loop:

RUNNING AND COMPLILING

By using do while:
RUNNING ANDC COMPILING :

TASK#04
Write C++ program to display Fibonacci series using for looP
RUNNING AND COMPLING

TASK#05
Write C++ program to find & print factorial of a given number using for loop
RUNNING AND COMPILING

You might also like