What are three types of repetition structures in C programming?
While Repetition Structure:
A repetition statement allows you to specify that an action is to be repeated while some condition remains true. It’s also called as counter controlled repetition. In this repetition we exactly know how many times the statements will be repeated.
Simple C program to print “Hello World” string 5 times
i = 0;
while ( i <= 4 ) {
printf(‘Hello World! \n’);
i = i+1;
}
Do-While Repetition Structure:
The do…while repetition statement is similar to the while statement. In the while statement, the loop-continuation condition is tested at the beginning of the loop before the body of the loop is performed.
In do…while statement, the loop-continuation condition is tested after the loop body is performed.
Therefore, the loop body will be executed at least once
do {
statement
} while ( condition );
For Repetition Structure:
Results
Sr# | Name | Roll No | Marks |
---|---|---|---|
1 | 16-mscit-21 Shamraiz Iqbal (Repeater) | 16-mscit-21 | NA |
2 | 16-mscit-29 Iram Naz (Repeater) | 16-mscit-29 | NA |
3 | 17-mscit-01 Ayesha Kanwal | 17-mscit-01 | NA |
4 | 17-mscit-02 Arbaz Naeem | 17-mscit-02 | NA |
5 | 17-mscit-03 Adeela Rani | 17-mscit-03 | NA |
6 | 17-mscit-04 Shaista Khan | 17-mscit-04 | NA |
7 | 17-mscit-05 Asma Benish | 17-mscit-05 | NA |
8 | 17-mscit-06 Maria Ummar | 17-mscit-06 | NA |
9 | 17-mscit-07 Azka Riaz | 17-mscit-07 | NA |
10 | 17-mscit-08 Shar Bano | 17-mscit-08 | NA |
11 | 17-mscit-09 Sahrish Ansar | 17-mscit-09 | NA |
12 | 17-mscit-10 Maryam Akram | 17-mscit-10 | NA |
13 | 17-mscit-11 Seerat Zhra | 17-mscit-11 | NA |
14 | 17-mscit-12 Sana Sultan | 17-mscit-12 | NA |
15 | 17-mscit-13 Kiran Yasmeen | 17-mscit-13 | NA |
16 | 17-mscit-14 Bilal Afzal | 17-mscit-14 | NA |
17 | 17-mscit-15 Pakeeza Arshad | 17-mscit-15 | NA |
18 | 17-mscit-16 Muhammad Zia Awan | 17-mscit-16 | NA |
19 | 17-mscit-17 Fariha Maryam | 17-mscit-17 | NA |
20 | 17-mscit-18 Muhammad Jahangir Alam | 17-mscit-18 | NA |
21 | 17-mscit-19 Tahseena Kanwal | 17-mscit-19 | NA |
22 | 17-mscit-20 Arslan Habib | 17-mscit-20 | NA |