- INTRODUCING
- PYTHON BASICS
- DATA STRUCTURES
- FUNCTIONS AND MODULES
- DEFINING AND CALLING FUNCTIONS
- PARAMETERS AND RETURN VALUES
- VARIABLE SCOPE AND GLOBAL/LOCAL VARIABLES
- IMPORTING AND USING MODULES
- CREATING AND USING CUSTOM MODULES
- FILE HANDLING:
- OBJECT-ORIENTED PROGRAMMING (OOP)
- INTRODUCTION TO OOP CONCEPTS
- CLASSES, OBJECTS, AND ATTRIBUTES
- INHERITANCE AND POLYMORPHISM
- ENCAPSULATION AND DATA HIDING
- OVERLOADING AND OVERRIDING METHODS
- ERROR HANDLING
- UNDERSTANDING EXCEPTIONS AND ERRORS
- TRY-EXCEPT BLOCKS AND HANDLING EXCEPTIONS
- RAISING CUSTOM EXCEPTIONS
- PYTHON LIBRARIES
- INTRODUCTION TO POPULAR LIBRARIES LIKE NUMPY, PANDAS, AND MATPLOTLIB
- DATA MANIPULATION WITH NUMPY AND PANDAS
- DATA VISUALIZATION WITH MATPLOTLIB
- INTERFACING TO THE OS
- PROCESSSING INFORMATIONS
- WORKING WITH FILES
- DATA MANGEMENT AND STORAGE
- COMMUNICATION OVER A NETWORK
- PYTHON INTERVIEW
- BASICS OF PROGRAMING
- WHAT IS PROGRAMMING
- WHY WE NEED TO LEARN PROGRAMING
- BENEFITS OF LEARNING PROGRAMING
- SOME EXAMPLES OF PROGRAMING
- EXAMPLE OF BASIC CODING IN PYTHON PROGRAMING
- PYTHON INTRODUCTION
- COMMENTS IN PYTHON
- VARIABLE IN PYTHON
- DATA TYPES IN PYTHON
- NUMBERS IN PYTHON
- TYPE CASTING IN PYTHON
- STRING IN PYTHON
- BOOLEAN IN PYTHON
- OPERATORS IN PYTHON
- DATA STRUCTURE IN PYTHON
- CONDITIONAL STATEMENT IN PYTHON
- LOOPS IN PYTHON
- FUNCTION IN PYTHON
- LAMBDA IN PYTHON
- ARRAY IN PYTHON
- DATA STRUCTURE IN PYTHON
FOR LOOP
In C programming, a for
loop is a control flow statement that allows you to repeatedly execute a block of code for a specific number of times. The general syntax of a for
loop in C is as follows:
for (initialization; condition; update) {
// code to be executed in each iteration
// ...
}
Here's a breakdown of the components:
Initialization: This part is executed once before the loop starts. It is typically used to initialize a loop control variable.
Condition: This is a boolean expression that is evaluated before each iteration. If the condition is true, the loop continues; otherwise, it exits.
Update: This part is executed after each iteration and is often used to modify the loop control variable.
for(initialize ; check ; modify){
logic
}
#include<stdio.h>
void main()
{
for(int i=0 ;i<=10 ;i++)
{
printf(“%d”, i);
}
}
Output 12345678910
write a program to print the num b/w 10 – 1 using for loop
#include<stdio.h>
void main()
{
for(int i=10 ;i>0 ;i--)
{
printf(“%d”,i);
}
}
output 10987654321
Print the table of 2 using for loop
#include<stdio.h>
void main()
{
int j=2;
for(int i=1 ;i<=10 ;i++){
printf(“%d”, j*i);
}
}
output 2468101214161820