C программа для печати наибольшего числа в массиве

//simple c program to print smallest and largest number in an array
int main(){
int i,marks[10],num,sum;
printf("enter number of elements:");
scanf("%d",&num);

printf("enter %d elements:",num);
for(i=0;i<num;i++){
scanf("%d",&marks[i]);
}
printf("the smallest number is:%d\n ",marks[0]);
//largest number for loop
  for (int i = 1; i < num; i++) {
    if (marks[0] < marks[i]) {
      marks[0] = num;
    }
  }

printf("the largest number is:%d\n ",marks[0]);
return 0;
}
Marvin Mushima