repo.or.cz
/
letusc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
move to repo.or.cz
[letusc.git]
/
ch3
/
examples
/
exa14.c
blob
c7217243fb7893b9cf02d3cf018b536b000e562b
1
/*Break statements*/
2
3
#include<stdio.h>
4
5
int
main
()
6
{
7
int
num
,
i
;
8
9
i
=
2
;
10
11
printf
(
"Enter a number:"
);
12
scanf
(
"%d"
,&
num
);
13
14
while
(
i
<=
num
-
1
)
15
{
16
if
(
num
%
i
==
0
)
17
{
18
printf
(
"Not a prime number
\n
"
);
19
break
;
20
}
21
i
++;
22
}
23
if
(
i
==
num
)
24
printf
(
"This is a prime number"
);
25
26
return
0
;
27
}