Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int PoVelicini (float *niz, int vel, float n) {
- int i, veci=1, nema_ga=0;
- for (i=0; i<vel; i++)
- {
- if (niz[i]==n)
- nema_ga=1;
- }
- if (nema_ga==0) return -1;
- for (i=0; i<vel; i++)
- {
- if (niz[i]>n) veci++;
- }
- return veci;
- }
- int main () {
- float niz[5]={3.2,5.5, -8.1, 2.7, 3.1};
- printf("%d", PoVelicini(niz,5,3.1));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement