#include<stdio.h>
int main(){
    //define 2 "useless numbers"
    int a[3],max = 0, min = 1000000;
    // give values of the array by one loop
    for (int i=0;i<3;i++){
        scanf("%d",&a[i]);
    }
    // give values to max & min
    for (int i = 0;i <3;i++){
        if (max <a[i]){
            max = a[i];
        }
        if (min >a[i]){
            min = a[i];
        }
    }
    printf("The maximum number is : %d\n",max);
    printf("The minimum number is : %d\n",min);
    return 0;
}
  1. define 2 "useless numbers"
  2. give values of the array by one loop
  3. give values to max & min

self-tries:

#include<stdio.h>
int main(){
    //define 2 "useless numbers"
    int a[3],max = 0, min = 1000000;
    // give values of the array by one loop
    for(int i = 0; i<3; i++){
        scanf("%d",&a[i]);
    }
    // give values to `max` & `min`
    for(int i =0; i<3; i++){
        if (max < a[i]){
            max = a[i];
        }
        if (min >a[i]) {
            min = a[i];
        }
    }
    printf("The maximum number is : %d\n",max);
    printf("The minimum number is : %d\n",min);
    return 0;
}