#include <stdio.h>



int maxCent (int a, int b) {
   if (a < 1000 || b < 1000) {
        printf("Errore");
        return -1000;
    } 
    int x= (a / 100) %10;
    int y= (b / 100) %10;
  
     if (x > y) {
    return 1;
   }
   else if (y>x) {
       return -1;
   }
    else {
        return 0;
    }  
}
int main() {
    int a=0;
    int b=0;
     printf("Inserisci due numeri maggiori di 1000: \n");
     scanf("%d %d",&a,&b);
   int max = maxCent(a,b);
    printf("%d",max);
   
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: