Lab 06
Lab 06
Lab 06
PROGRAMMING FUNDAMENTALS
Lab 06: Understanding Looping Structure
Under
Introduction:
Loops: Loops are used in programming to repeat a specific block of code until
some end condition is met. There are three types of Loops in C++ Programming.
1. For loop
2. While loop
3. Do while loop
for Loop Syntax:
The codes inside the body of loop is executed at least once. Then, only the
test expressionis checked.
If the test expression is true, the body of loop is executed. This process
continues untilthe test expression becomes false.
When the test expression is false, do...while loop is terminated.
c) While testing on last two inputs, it may work abnormally. Now modify above
program so that it should work t time where t is difference between
start/end.
d) How for/while/do-while loop behaves?
2:
Write a C++ Program and ask user to enter any positive integer and then display the multiplication table
upto some range given by user.
3:
Write a program to display the prime number b/w 0 to 100
4:
Write a program to ask user input n_courses (Total Courses), then iterate loop
n_courses time and ask user marks in each course and perform following tasks:
a) Calculate total percentage of all courses.
c) PASS.
5:
Write a program that will ask you to enter any number and then the program
should tell y o u whether the number is palindrome or not?
…END…