Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define N 7
- int massimo(int v[]);
- int main (void)
- {
- int vet[N],mass,i;
- srand(time(0));
- for(i=0;i<N;i++)
- {
- vet[i]=(rand()%24)+2;
- printf("%d\t",vet[i]);
- }
- mass=massimo(vet);
- printf("\n%d",mass);
- }
- int massimo (int v[])
- {
- int max=0,i;
- for(i=0;i<N;i++){
- if(v[i]>max){
- max=v[i];
- }
- }
- return max;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement