Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // Ovo je ujedno prvi zadatak sa ispisima iz fajla or-rokovi-ispisi-i-mali-zadaci.pdf
  2.  
  3. #include<stdio.h>
  4. void f1(char *x, char *s)
  5. {
  6. while(*x++!='\0');
  7. x--;
  8. while(*s!='\0') *x++=*s++;
  9. *x='\0';
  10. }
  11. f2(char *x)
  12. {
  13. int q;
  14. q=*x++;
  15. q++;
  16. q+=*x++;
  17. return q;
  18. }
  19. f3(char *x,int s)
  20. {
  21. *++x=s;
  22. *x++='-';
  23. x++;
  24. *x--=s;
  25. }
  26. int main()
  27. {
  28. int P[4][4]={1,8,15,22};
  29. char s[8]="Travnik";
  30. char Q[5]={'A','E','I','O','\0'};
  31. int q,p=1;
  32. q=P[1][1]+Q[3];
  33. printf("%d\n",q);
  34. f1(s,Q);
  35. printf("%s\n",s);
  36. q=f2(Q);
  37. printf("%d\n",q);
  38.  
  39. f2(P);
  40. printf("%d\n",p);
  41.  
  42. f3(s,Q[0]);
  43. printf("%s\n",s);
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement