fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int exemplo1() { return 1; }
  6.  
  7. int exemplo2(int i) { return i * 2; }
  8.  
  9. int exemplo3() {
  10. srand(time(0));
  11. return rand();
  12. }
  13.  
  14. int exemplo4(int i) { return i > 0 ? 1 : 0; }
  15.  
  16. int main(void) {
  17. printf("%i\n", exemplo1());
  18. printf("%i\n", exemplo2(2));
  19. printf("%i\n", exemplo3());
  20. printf("%i\n", exemplo4(2));
  21. }
  22.  
  23. //https://pt.stackoverflow.com/q/38935/101
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
1
4
874346824
1