Crackbone

dv5z1v1

Apr 13th, 2021
495
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*1. Koristeći uvjetni operator (?:) napisati funkciju koja vraća najmanji od tri broja.
  2. Zabranjeno je koristiti if naredbu.*/
  3.  
  4.  
  5.  
  6. #define _CRT_SECURE_NO_WARNINGS
  7.  
  8. #include<stdio.h>
  9.  
  10. int funkcija(int, int, int);
  11.  
  12. int main()
  13. {
  14.     int a, b, c;
  15.     printf("\nUnesi tri broja:\n");
  16.     scanf(" %d %d %d", &a, &b, &c);
  17.     printf("Najmanji broj je: %d", funkcija(a, b, c));
  18.  
  19.     getchar();
  20.     getchar();
  21.     return 1;
  22. }
  23.  
  24. int funkcija(int a, int b, int c)
  25. {
  26.     int d;
  27.     d = (a < b) ? a : b;
  28.     d = (c < d) ? c : d;
  29.  
  30.     return d;
  31.  
  32. }
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.

×