-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpretplata minimalac2.c
More file actions
41 lines (31 loc) · 883 Bytes
/
pretplata minimalac2.c
File metadata and controls
41 lines (31 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <stdlib.h>
float trosak_petplate(int N, float x) //definicija funkcije
{
return N*x;
}
void trosakPretplate2(int *N, float *x, float *rez)
{
*rez=*N * *x;
}
/*float trosak_petplate3(int N, float x=15.99)//definicija funkcije
{
return n*x
}*/
{
int main()
{
int brPrijatelja;
float cijena, trosak;
printf("Unesi broj prijatelja: ");
scanf("%d", &brPrijatelja);
printf("Unesi cijenu pretplate: ");
scanf("%f", &cijena);
trosak = trosak_petplate(brPrijatelja, cijena), //poziv funkcije
printf("minimalni trosak pretplate iznosi %.2f", trosak);
trosakPretplate2(&brPrijatelja, &cijena, &trosak);
printf("minimalni trosak pretplate iznosi %.2f", trosak);
//trosak = trosakpretplate(brPrijatelja);
// poziv funkcije a zadanim argumentom
return 0;
}