-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhile.c
More file actions
56 lines (37 loc) · 787 Bytes
/
Copy pathwhile.c
File metadata and controls
56 lines (37 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//// WHILE LOOP IN C PROGRAMMING
# include <stdio.h>
int main (){
/* Syntax
while (){
statements;
}
*/
// A program to produce a multiplication table
/*int count=1;
int number;
printf("Enter number ;");
scanf("%d",&number);
while (count<=10){
printf("%d * %d =%d\n",count,number,count*number);
//count++;
++count;
}
*/
//// DO WHILE LOOP
// when using the do while loop, the body of the program is executed then the test condition is verified
/* syntax for the do while loop
do{
body of the loop
} while ( test condition);
*/
int count=10;
int number=9;
//printf("Enter number ;");
//scanf("%d",&number);
while (count<=10 && count>0){
printf("%d * %d =%d\n",count,number,count*number);
//count++;
--count;
}
return 0;
}