Need help with Challenge #2

+2 Snir Cohen · February 7, 2015


Post a Reply

Replies

Oldest  Newest  Rating
0 c student · February 7, 2015
variable Okay is of type char meaning you should use a string conversion (%s) or you will be accessing invalid memory
for loop is used like this:
for (initial condition; break condition; variable update)

if you need more help, please tell us specifically what you need help with.  we can't read your mind.
0 Snir Cohen · February 7, 2015

#include
#include
#include
#include
#include

int main()
{
    int Dice1;
    int Dice2;
    int Dice3;
    int Dice4;
    int Dice5;
    int Dice6;
    int RollSum;
    int RollSum2;
    char Guess;
    char Okay;

    printf("Hello, please enter any key to roll the dice ");
    scanf(" %s", &Okay);
    Okay = 'r';
    if (Okay == 'r'){
    for(Dice1=0 ; Dice1
  • 1

C

107,322 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator