Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //// 1 ZADATAK
- //
- //#include <stdio.h>
- //#define _CRT_SECURE_NO_WARNINGS
- //
- //float VOLUMEN(float r, float h);
- //
- //int main(void) {
- // float r = 0;
- // float h = 0;
- // printf("Unesi polumjer valjka:");
- // scanf_s("%f", &r);
- // printf("Unesi visinu valjka:");
- // scanf_s("%f", &h);
- // printf("Ovo je VOLUMEN zadanog valjka %f\n", VOLUMEN(r, h));
- // return 0;
- //}
- //
- //
- //float VOLUMEN(float r, float h) {
- // float c = 0;
- // c = (3.14)*(r*r)*(h);
- // return c;
- //}
- ////2 ZADATAK
- //
- //#include <stdio.h>
- //#define _CRT_SECURE_NO_WARNINGS
- //float SVNB(int n);
- //
- //
- //int main(void) {
- // int n;
- // printf("UPISI PRIRODNI BROJ");
- // scanf_s("%d", &n);
- // printf("Srednja vrijednost do n prirodnog broja je %f\n", SVNB(n));
- //
- //
- // return 0;
- //}
- //
- // float SVNB(int n) {
- // int i;
- // float c = 0;
- // float b = 0;
- // float rez = 0;
- // for (i = 1; i <= n; i++) {
- // c = c + i;
- //
- // }
- //
- // for (i = 0; i < n; i++) {
- // b++;
- //
- // }
- //
- // rez = c / b;
- // return rez;
- //
- //}
- //
- ////3 ZADATAK
- //
- //#include <stdio.h>
- //#define _CRT_SECURE_NO_WARNINGS
- //float SVNB(int m, int n);
- //int main(void) {
- // int m;
- // int n;
- // do {
- // printf("Unesi prirodni broj m i prirodno broj n:");
- // scanf_s("%d %d", &m, &n);
- //
- // } while (m > n);
- //
- // printf("Ovo je srednja vrijednost brojeva izmedu m i n %f \n", SVNB(m, n));
- //
- // return 0;
- //}
- //
- //float SVNB(int m, int n) {
- // int i;
- // float c = 0;
- // float b = 0;
- // float rez = 0;
- // for (i = m; i <= n; i++) {
- // c = c + i;
- //
- // }
- //
- // for (i = m; i <= n; i++) {
- // b++;
- //
- // }
- //
- // rez = c / b;
- // return rez;
- //
- //}
- //
- ////4 ZADATAK
- //
- //#include <stdio.h>
- //#define _CRT_SECURE_NO _WARNINGS
- //#include <math.h>
- //float STAJEOVO(float a, float b, float c);
- //int main(void) {
- // float a, b, c;
- // printf("Unesi stranice trokuta a, b i c:");
- // scanf_s("%f %f %f", &a, &b, &c);
- // printf("Povrsina je %f", STAJEOVO(a, b, c));
- //
- //
- //
- // return 0;
- //}
- //
- //
- //float STAJEOVO(float a, float b, float c) {
- // float s;
- // float P;
- //
- // s = (a + b + c) / (2);
- // P = (s*(s - a)*(s - b)*(s - c));
- // P = sqrt(P);
- // return P;
- //
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement