Advertisement
Guest User

zadaci

a guest
Nov 24th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. //// 1 ZADATAK
  2. //
  3. //#include <stdio.h>
  4. //#define _CRT_SECURE_NO_WARNINGS
  5. //
  6. //float VOLUMEN(float r, float h);
  7. //
  8. //int main(void) {
  9. // float r = 0;
  10. // float h = 0;
  11. // printf("Unesi polumjer valjka:");
  12. // scanf_s("%f", &r);
  13. // printf("Unesi visinu valjka:");
  14. // scanf_s("%f", &h);
  15. // printf("Ovo je VOLUMEN zadanog valjka %f\n", VOLUMEN(r, h));
  16. // return 0;
  17. //}
  18. //
  19. //
  20. //float VOLUMEN(float r, float h) {
  21. // float c = 0;
  22. // c = (3.14)*(r*r)*(h);
  23. // return c;
  24. //}
  25.  
  26.  
  27.  
  28.  
  29. ////2 ZADATAK
  30. //
  31. //#include <stdio.h>
  32. //#define _CRT_SECURE_NO_WARNINGS
  33. //float SVNB(int n);
  34. //
  35. //
  36. //int main(void) {
  37. // int n;
  38. // printf("UPISI PRIRODNI BROJ");
  39. // scanf_s("%d", &n);
  40. // printf("Srednja vrijednost do n prirodnog broja je %f\n", SVNB(n));
  41. //
  42. //
  43. // return 0;
  44. //}
  45. //
  46. // float SVNB(int n) {
  47. // int i;
  48. // float c = 0;
  49. // float b = 0;
  50. // float rez = 0;
  51. // for (i = 1; i <= n; i++) {
  52. // c = c + i;
  53. //
  54. // }
  55. //
  56. // for (i = 0; i < n; i++) {
  57. // b++;
  58. //
  59. // }
  60. //
  61. // rez = c / b;
  62. // return rez;
  63. //
  64. //}
  65. //
  66.  
  67. ////3 ZADATAK
  68. //
  69. //#include <stdio.h>
  70. //#define _CRT_SECURE_NO_WARNINGS
  71. //float SVNB(int m, int n);
  72. //int main(void) {
  73. // int m;
  74. // int n;
  75. // do {
  76. // printf("Unesi prirodni broj m i prirodno broj n:");
  77. // scanf_s("%d %d", &m, &n);
  78. //
  79. // } while (m > n);
  80. //
  81. // printf("Ovo je srednja vrijednost brojeva izmedu m i n %f \n", SVNB(m, n));
  82. //
  83. // return 0;
  84. //}
  85. //
  86. //float SVNB(int m, int n) {
  87. // int i;
  88. // float c = 0;
  89. // float b = 0;
  90. // float rez = 0;
  91. // for (i = m; i <= n; i++) {
  92. // c = c + i;
  93. //
  94. // }
  95. //
  96. // for (i = m; i <= n; i++) {
  97. // b++;
  98. //
  99. // }
  100. //
  101. // rez = c / b;
  102. // return rez;
  103. //
  104. //}
  105.  
  106. //
  107. ////4 ZADATAK
  108. //
  109. //#include <stdio.h>
  110. //#define _CRT_SECURE_NO _WARNINGS
  111. //#include <math.h>
  112. //float STAJEOVO(float a, float b, float c);
  113. //int main(void) {
  114. // float a, b, c;
  115. // printf("Unesi stranice trokuta a, b i c:");
  116. // scanf_s("%f %f %f", &a, &b, &c);
  117. // printf("Povrsina je %f", STAJEOVO(a, b, c));
  118. //
  119. //
  120. //
  121. // return 0;
  122. //}
  123. //
  124. //
  125. //float STAJEOVO(float a, float b, float c) {
  126. // float s;
  127. // float P;
  128. //
  129. // s = (a + b + c) / (2);
  130. // P = (s*(s - a)*(s - b)*(s - c));
  131. // P = sqrt(P);
  132. // return P;
  133. //
  134. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement