Advertisement
lazar955

Untitled

May 8th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include<stdio.h>
  4. #include<string.h>
  5. #include<stdlib.h>
  6. typedef int NIZ[100];
  7.  
  8. void unosUNiz(NIZ niz, int *brel){
  9. char odgovor = ' ';
  10. int broj;
  11.  
  12. while (odgovor != 'n')
  13. {
  14. printf("Unesi broj: ");
  15. scanf("%d", &broj);
  16.  
  17. niz[*brel] = broj;
  18.  
  19. (*brel)++;
  20.  
  21. printf("da li zelite da nastavite? Y/N\n");
  22. fflush(stdin);
  23. scanf("%c", &odgovor);
  24. }
  25.  
  26. }
  27.  
  28. void prikazi(NIZ niz, int brel){
  29. int i;
  30. for (i = 0; i < brel; i++)
  31. {
  32. printf("%d ", niz[i]);
  33. }
  34. printf("\n");
  35. }
  36.  
  37. void unesiElementNaKrajNiz()
  38.  
  39. int main(void){
  40. NIZ niz;
  41. int brel = 0;
  42.  
  43.  
  44. unosUNiz(niz, &brel);
  45.  
  46. prikazi(niz, brel);
  47.  
  48. return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement