Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. int main(int argc, char *argv[]) {
  5.     int tab[6],i,x;
  6.     srand(time(NULL));
  7.     for(i=0;i<6;i++)
  8.         tab[i]=rand()%21;
  9.     printf("Podaj liczbe: ");
  10.     scanf("%d",&x);
  11.     for(i=0;i<6;i++){
  12.         if(tab[i]==x){
  13.             printf("Liczba %d wystepuje w tablicy",x);
  14.         }
  15.     }
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement