#include <stdio.h>
#include <stdlib.h>

int main() {
    int v=1;
    while (v) {
        int n=-1;
        int i=0;
        int k = rand()%10;
        while (n!=k) {
            i++;
            scanf("%d\n",&n);
            if (n>k) 
                printf("plus petit\n");
            if (n<k)
                printf("plus grand\n");
        
        }   
        printf("bien joué vous avez trouvé en %d tentative, voulez-vous rejouer ?\n",i);
        scanf("%d\n",&v);
    }
}

Embed on website

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