Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int broj,i=2;
- printf("Unesite broj: ");
- scanf("%d", &broj);
- if (broj<=0) {
- printf("Broj nije prirodan.");
- return 0;
- }
- if (broj==1) {
- printf("Broj nije ni prost ni slozen.");
- return 0;
- }
- while(i<broj) {
- if (broj%i==0) {printf("Broj je slozen."); return 0; }
- i++;
- }
- printf("Broj je prost.");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement