1. 1.
    0
    #include <stdio.h>
    4. include <conio.h>
    5. include <time.h>
    6. include <stdlib.h>

    void mix(int n);
    void myMenu(void);

    int main()
    {
    myMenu();
    int n;
    printf("Kac kere zar atilsin = ");
    scanf("%d",&n);

    mix(n);

    srand(time(NULL));
    system("pause");
    }
    void mix(int n)
    {
    int myArray[7]={0};
    int loop=0,i=0;

    while((i<=6)&&(loop<n))
    {
    i=rand()%7;
    switch(i)
    {
    case 1:myArray[1]++; break;
    case 2:myArray[2]++; break;
    case 3:myArray[3]++; break;
    case 4:myArray[4]++; break;
    case 5:myArray[5]++; break;
    case 6:myArray[6]++; break;

    default: loop--; break;

    }

    loop++;
    }
    printf("n");
    for(i=1;i<=6;i++)
    {
    printf("%d'den %d tane varn",i,myArray[i]);
    }
    printf("n%d kez zar atilmistirn",loop);
    }
    void myMenu(void)
    {
    printf("ttAtilan Zarin Kac Geldigini Hesaplayan Uygulama nn");

    }
    ···
   tümünü göster