Crackbone

dv5z2

Apr 12th, 2021
611
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*2. Napisati funkciju sa prototipom int funkcija(int a, int b);, koja vraća razliku
  2. a-b ako je a ≥ b, a inače vraća zbroj a+b. Koristiti uvjetni operator (?:). Zabranjeno
  3. je koristiti if naredbu.*/
  4.  
  5.  
  6. #define _CRT_SECURE_NO_WARNINGS
  7.  
  8. #include<stdio.h>
  9.  
  10. int funkcija(int, int);
  11.  
  12. int main()
  13. {
  14.     int a, b;
  15.     printf("Upisi dva broja a i b:\n");
  16.     scanf(" %d %d", &a, &b);
  17.     printf("\n %d", funkcija(a, b));
  18.     getchar();
  19.     getchar();
  20.     return 1;
  21. }
  22.  
  23.  
  24. int funkcija(int a, int b)
  25. {
  26.     (a >= b) ? (a= a-b) : (a=a+b);
  27.     return a;
  28.  
  29.  
  30. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×