PFLabmanual 5
PFLabmanual 5
Sciences Narowal
PROGRAMMING FUNDAMENTAL
LAB MANUAL 5
Semester 1st
Problem 1
A program using while loop to print numbers from 1 to 10.
Output
Problem 2
A program to print sum of numbers from 1 to n using while loop.
Output
Problem 3
A program that prints numerals in reverse using while loop.
Output
Problem 4
A program that displays the Fibonacci series using a while loop.
Output
To do Tasks
1. Write a program that takes a number as input and displays its multiplication table (from 1
to 10) using a while loop.
2. Write a program that calculates the sum of the squares of the first N natural numbers
using a while loop
3. Create a program where the user tries to guess a pre-defined number (e.g., 7). Keep
prompting the user for input until they guess correctly using a while loop.