fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(){
  4. ///komentarzh25yjnbgtcexdwa
  5. int liczba;
  6. float ulamek;
  7.  
  8. // przyklad nr 1
  9. printf("przyklad nr 1\n");
  10. printf("podaj liczbe calkowita:");
  11. scanf_s("%d", &liczba);
  12. if(liczba==8) return 0;
  13. if(liczba>0)
  14. printf("\nPodano liczbe wieksza od 0\n");
  15. if(liczba<0) printf("Podano liczbe mniejsza od 0\n");
  16. if(liczba==0)
  17. printf("podano");
  18. printf(" zero\n");
  19. if (liczba > 0 && liczba % 2 == 0) {
  20. printf("\nPodano liczbe wieksza od 0 parzysta\n");
  21.  
  22. } else if (liczba > 0 && liczba % 2 == 1) {
  23. printf("\nPodano liczbe wieksza od 0 i nieparzysta\n");
  24. } else if(liczba < 0 && liczba % 2 == 0) {
  25. printf("\nPodano liczbe mniejsza od 0 parzysta\n");
  26. }
  27. else if (liczba < 0 && liczba % 2 == 1) {
  28. printf("\nPodano liczbe mniejsza od 0 i nieparzysta\n");
  29. }
  30. else {
  31. printf("\ncos poszlo nie tak\n");
  32. }
  33.  
  34. if(liczba >5 || liczba <-5) {
  35. printf("\npodano liczbe o wartosci bezwzglednej wiekszej niz 5\n");
  36. }
  37.  
  38. system("pause");
  39. // przyklad nr 2
  40. printf("przyklad nr 2\n");
  41. printf("podaj liczbe ulamkowa:");
  42. scanf_s("%f",&ulamek);
  43. if(ulamek>1)
  44. printf("\nPodano liczbe wieksza od 1\n");
  45. else if(ulamek<-1)
  46. printf("Podano liczbe mniejsza od -1z\n");
  47. else{
  48. printf("podano");
  49. printf(" ulamek z zakresu (-1,1)\n");
  50. }
  51. system("pause");
  52. return 0;
  53. }
  54.  
  55.  
Compilation error #stdin compilation error #stdout 0s 2164KB
stdin
88
0.5
compilation info
prog.c: In function ‘main’:
prog.c:11:5: warning: implicit declaration of function ‘scanf_s’; did you mean ‘scanf’? [-Wimplicit-function-declaration]
     scanf_s("%d", &liczba);
     ^~~~~~~
     scanf
prog.c:16:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if(liczba==0)
     ^~
prog.c:18:14: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
              printf(" zero\n");
              ^~~~~~
prog.c:38:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
     system("pause");
     ^~~~~~~~~~~~~~~
prog.c:51:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
     system("pause");
     ^~~~~~~~~~~~~~~
/usr/bin/ld: /home/UIgYEX/ccv4IRNK.o: in function `main':
prog.c:(.text.startup+0x45): undefined reference to `scanf_s'
/usr/bin/ld: prog.c:(.text.startup+0xfc): undefined reference to `scanf_s'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty