Jump to content

Need additional code for this C program??

- - - - -

  • Please log in to reply
5 replies to this topic

#1
arjun2

arjun2

    Newbie

  • Members
  • Pip
  • 5 posts
Actually the aim of the game is, six numbers are generated between 1-40 and a player can bet six numbers between 1-40.
If the player get all the six numbers correct he wins the jackpot. Each bet costs Rs 20
Thus In the program below i want to create codes such that:
a bet costs Rs 20 and a player can play as many times as he wishes for each draw.
Then the program should display the bet and the total bet.


#include <stdio.h>

#include <stdlib.h>


void fCompare(int userNumbers[6]);


int main()

{


    int userNumbers[] = {0,0,0,0,0,0};

    

    printf("Please bet 6 numbers in the range 1-40: ");

    scanf("%d %d %d %d %d %d",&userNumbers[0],&userNumbers[1],&userNumbers[2],&userNumbers[3],&userNumbers[4],&userNumbers[5]);

    printf("\n");

    fCompare(userNumbers);


    system ("PAUSE");

    return 0 ;

}


void fCompare(int userNumbers[6])

{

    int i = 0;

    int true = 1;

    int correct = 0;

    for(i = 0; i < 6; i++)

    {

        if(userNumbers[i] == true ) correct++;

    }

    if (correct == 6) //do something

        printf("God is good");

}

Edited by arjun2, 05 November 2011 - 05:49 AM.


#2
fread

fread

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 787 posts
What is your strategy?
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:

#3
¥ Brutus ¥

¥ Brutus ¥

    Newbie

  • Members
  • Pip
  • 7 posts
Probably you have to better explain the aim of the game!

#4
arjun2

arjun2

    Newbie

  • Members
  • Pip
  • 5 posts
I already include the aim! now i want to know what codes
should i need?? Help me to solve this!!

#5
alex1

alex1

    Learning Programmer

  • Members
  • PipPipPip
  • 93 posts
Why I think you are trying to do this by the hard way?It seems like an assigment,since there is a simillar post to yours.Just think simple.If you don't make it within 2 days I will help you.

#6
fread

fread

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 787 posts

alex1 said:

Why I think you are trying to do this by the hard way?It seems like an assigment,since there is a simillar post to yours.Just think simple.If you don't make it within 2 days I will help you.
I will help to. I edited that code in another thread. Try and we will help. :P
Perfection of means and confusion of ends seem to characterize our age. Albert Einstein :confused:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users