#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
int max,min;
for(int i=0;i<n;i++){
int num;
scanf("%d",&num);
}
return 0;
}
This code reads an integer `n` and then attempts to read `n` more integers in a loop, but it does not compare them to find the maximum and minimum values. The variables `max` and `min` are declared but never assigned or used.
- Inside the loop, after reading each number with `scanf`, you need to compare it with the current `max` and `min` values. Think about how to initialize `max` and `min` before the loop starts, for example by setting them to the first number read.
- The loop currently does nothing with the numbers after reading them. You should add logic to update `max` and `min` for each number.