#include<stdio.h>
#include<stdlib.h>
int main()
{
int magic;
int guess;
int counter = 0;
magic = rand() % 100 + 1;
do{
printf("please guess a magic numbre:");
scanf("%d",&guess);
counter++;
if(guess>magic)
printf("Wrong! Too big!\n");
else if(guess<magic)
printf("Wrong! Too small!\n");
else
printf("Right!\n");
}while(guess ! = magic);
printf("counter = %d\n",counter);
return 0;
}