C Module 3 Sesstion 5
C Module 3 Sesstion 5
Assistant Professor | Department of Computer Science & Engineering | Faculty of Engineering & Technology
Jump Statements
Jump Statements
Definition of Loops in C
Types of Loops
Nested Loops
Control Statements
Real-Case Examples
Importance
PLACEMENT TRAINING PROGRAMME :INTRODUCTION TO C PROGRAMING | 2024
#include <stdio.h>
int main() {
int distanceInMeters = 1000;
7 x 9 = 63 7 x 10 = 70
int main() {
for(int i = 1; i <= 7; i++) {
printf("%d\n", i);
}
return 0;
}
PLACEMENT TRAINING PROGRAMME :INTRODUCTION TO C PROGRAMING | 2024
3. Nested do-while Loops
Nested do-while loops are similar to nested while loops.
They are useful for tasks that require the repeated execution
of specific actions based on a condition.
PLACEMENT TRAINING PROGRAMME :INTRODUCTION TO C PROGRAMING | 2024
Output
Welcome to the Number Guessing Game!
Enter your guess: Congratulations!
You guessed the correct number.
Thank you for playing!
print_num:
if (num < 7) {
printf("%d ", num);
num++;
goto print_num; // Jump back to
the label and execute the code again
}
return 0;
}
THANK U
53
https://unstop.com/blog/control-statements-in-c