Онлайн компилятор C

#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); if(i==0){ max==min; } } return 0; }
The code reads an integer `n` and then attempts to read `n` numbers in a loop. It declares `max` and `min` but does not initialize them. Inside the loop, it tries to set `max` equal to `min` when `i` is 0, but uses `==` (comparison) instead of `=` (assignment). After that, no further logic is implemented to update `max` or `min` based on the numbers.

- The line `max==min;` compares `max` and `min` but does nothing with the result. You likely meant to assign the first number to both `max` and `min`, but you used the wrong operator and also forgot to use `num`.
- After the first number, you need to compare each subsequent `num` with `max` and `min` to update them if `num` is larger or smaller.