fork(4) download
  1. // && - i logiczne czyli ^
  2. // || - lub logiczne czyli v
  3. // i++ post inkrementacja
  4. // ++i pre inkrementacja
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7.  
  8.  
  9. // program
  10. int main(){
  11. // post i pre inkrementacja
  12. int temperatura=8;
  13. int x,y;
  14. if(temperatura++==8)
  15. printf("temperatura stala jest %d\n", temperatura);
  16. if(++temperatura==10)
  17. printf("temperatura zmienna jest %d\n", temperatura);
  18. // wykorzystanie operatorow
  19. printf("podaj zmienna x\n");
  20. scanf_s("%d",&x);
  21. if(x>0 && x < 5)
  22. printf("x jest wiekszy od zero i mniejszy od piec\n");
  23. else printf("x jest mniejszy lub równy zero lub x jest mniejszy lub równy piec\n");
  24. printf("podaj zmienna y\n");
  25. scanf_s("%d",&y);
  26. //if(y<0)
  27. if((y<0 || y > 5) && (y>-2 || y<3))
  28. printf("y jest mniejszy od zera lub y jest wiekszy od piec\n");
  29. else printf("y jest wiekszy od zera i y jest mniejszy od 5\n");
  30. system("pause");
  31. return 0;
  32. }
Compilation error #stdin compilation error #stdout 0.01s 5436KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:20:5: warning: implicit declaration of function ‘scanf_s’; did you mean ‘scanf’? [-Wimplicit-function-declaration]
     scanf_s("%d",&x);
     ^~~~~~~
     scanf
prog.c:30:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
     system("pause");
     ^~~~~~~~~~~~~~~
/usr/bin/ld: /home/9g10iF/cccszurX.o: in function `main':
prog.c:(.text.startup+0x62): undefined reference to `scanf_s'
/usr/bin/ld: prog.c:(.text.startup+0xa6): undefined reference to `scanf_s'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty