Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
410 B
2
Indexable
Never
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
    srand(time(NULL));
    int sayi = rand() % 100;
    int tahmin;
    int sayac=0;
    do {
    printf("Tahmin:");
    scanf("%d",&tahmin);
    printf("Sayiyla tahmin arasindaki fark: %d \n",(sayi-tahmin));
    sayac++;
    }  while( tahmin!=sayi );
    printf("Tebrikler, %d. denemede buldun",sayac);
    return 0;
}
Leave a Comment