Advertisement
Josif_tepe

Untitled

Dec 1st, 2022
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void funkcija(int A, int B) {
  5.     for(int i = A; i <= B; i++) {
  6.         int broj_na_deliteli = 0;
  7.         for(int j = 1; j <= i; j++) {
  8.             if(i % j == 0) {
  9.                 broj_na_deliteli++;
  10.             }
  11.         }
  12.         if(broj_na_deliteli == 2) {
  13.             printf("%d ", i);
  14.         }
  15.     }
  16. }
  17.  
  18. int main() {
  19.     int A, B;
  20.     scanf("%d%d", &A, &B);
  21.     funkcija(A, B);
  22.    
  23.    
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement