Hello Friend I am Deepak Saini Again and tut for C language Loops may be helpfull for Noobs.
Lets Start :-
Loop :- We are using loops for repeat the instruction according to our condition.When the condition is false then our loop is terminate and give output of Else condition if we give in our program.
How many type of loops uses in C language.
We are using three type of loops in C .
1 For Loop
2 While loop
3 Do-While Loop
The While Loop :- I m not giving here big example but i just give a little example her .
Ex:- #include<stdio.h>
int main()
{
int a ;
a = 1;
while ( a >= 5 )
{
You do is here what u want to do
a = a + 1;
}
I this we are using a = 1 and when a >= 5 then our loop is break otherwise its repeat the do .
In All loops we are using same method we are first insert the value of one variable then we are compare the value to the our condition value the we are add one in this vaule and check the value is equal to or grater the our condition value then do next setup and our loop terminate and going for else or stop the program and exit.
Thats it i understand i share here if any problem then give feedback :) we try to improve it and fix it in this tut.
Thanks For reading and Respect India and Indians:)
Jai Hind Jai Hind Jai Hind Jai Hind Jai Hind
Jai Bharat Jai Bharat Jai Bharat Jai Bharat
_/\__/\_ :)
Lets Start :-
Loop :- We are using loops for repeat the instruction according to our condition.When the condition is false then our loop is terminate and give output of Else condition if we give in our program.
How many type of loops uses in C language.
We are using three type of loops in C .
1 For Loop
2 While loop
3 Do-While Loop
The While Loop :- I m not giving here big example but i just give a little example her .
Ex:- #include<stdio.h>
int main()
{
int a ;
a = 1;
while ( a >= 5 )
{
You do is here what u want to do
a = a + 1;
}
I this we are using a = 1 and when a >= 5 then our loop is break otherwise its repeat the do .
In All loops we are using same method we are first insert the value of one variable then we are compare the value to the our condition value the we are add one in this vaule and check the value is equal to or grater the our condition value then do next setup and our loop terminate and going for else or stop the program and exit.
Thats it i understand i share here if any problem then give feedback :) we try to improve it and fix it in this tut.
Thanks For reading and Respect India and Indians:)
Jai Hind Jai Hind Jai Hind Jai Hind Jai Hind
Jai Bharat Jai Bharat Jai Bharat Jai Bharat
_/\__/\_ :)
0 comments:
Post a Comment