Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int funkcijazaprost(int n){
- if(n==1){
- // printf("Brojot ne e ni prost ni slozen");
- return -1;
- }
- if(n==2){
- // printf("Brojot ne e ni prost ni slozen");
- return 1;
- }
- int i;
- for(i=2;i<n;i++){
- if(n%i==0)
- return 0;
- }
- return 1;
- }
- int main()
- {
- int n;
- int i;
- scanf("%d",&n);
- if(funkcijazaprost(n)==1){
- printf("Prost e ");
- }
- if(funkcijazaprost(n)==-1){
- printf("Brojot ne e ni prost ni slozen");
- }
- else{
- printf("Ne e prost");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement