- 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
WHILE LOOP
In C programming, a while
loop is used to repeatedly execute a block of code as long as a specified condition is true. The syntax for a while
loop in C is as follows:
while (condition) {
// code to be executed while the condition is true
// ...
}
Here, condition
is a boolean expression. The code inside the curly braces will be executed repeatedly as long as the condition is true. Once the condition becomes false, the loop will exit, and the program will continue with the next statement after the while
loop.
This code is to print number b/w 1 to 100
#include<stdio.h>
void main()
{
int i=1;
while(i<=100)
{
printf(“%d/n”,i);
i=i+1;
}
}
This code is to print table of 2
#include<stdio.h>
void main()
{
int i=1;
while(i<=10)
{
printf(“2*%d=%d/n”,I,2*i);
i=i+1;
}
}
This code is to print table of 2 in reverse order
#include<stdio.h>
void main()
{
int i=10;
while(1>0)
{
printf(“2*%d=%d/n”,I,2*i);
i=i-1;
}
}