SHARE
TWEET

niz7

a guest Mar 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Program koji ispisuje sve parne clanove niza u novi niz
  2.  
  3. #include<stdio.h>
  4.  
  5. int main(){
  6.  
  7.     int n,i;
  8.     int niz[50];
  9.     int niz2[50];
  10.     int j=0;
  11.    
  12.     do{
  13.         printf("Unesi broj od 1 do 50: ");
  14.         scanf("%d", &n);
  15.     }while(n<0 || n>50);
  16.    
  17.     for(i=0;i<n;i++){
  18.         printf("niz[%d]= ",i);
  19.         scanf("%d",&niz[i]);
  20.     }
  21.     printf("\n Parni elementi niza su: \n");
  22.         for(i=0;i<n;i++){
  23.             if(niz[i]%2==0){
  24.             niz2[j]=niz[i]/3;
  25.             j++;
  26.                 printf("%d \n", niz[i]);
  27.         }
  28.     }
  29.     return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top