EASY 2 LEARN 'C'
Home
DotNet
Tuesday, 28 August 2012
program for while loop
Program for while loop
syntax
:-
while(condition)
{
statements;
incrementation/decrementation;
}
Example for printing 1 to 10
:-
#include<stdio.h>
main()
{
int i=1;
clrscr();
while(i<=10)
printf("%d\n",i++);
getch();
}
output
:- 1
2
3
4
5
6
7
8
9
10
0 comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Search Box
'C' Language
'C' Programming
(27)
Arrays in 'C'
(5)
Interview Que's about 'C'
(8)
Strings in 'C'
(4)
Popular Posts
0 comments:
Post a Comment