C Programming- "Expected Expression Before % Token"

So I was trying to code a simple number guess game. I've done it in C++, so I decided to try it in C. However, on line 24 (scanf("%i,&reply)), my IDE (Code::Blocks, if that helps) keeps putting out "error: expected expression before % token". What do I do?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//Guessing Game- C
//Take 2
//
#include <stdio.h>

int main() {
    //Pose the challenge to the player
    printf("Think of any number between 1 and 100. I'll guess it in 7 guesses");
    printf(" or less. Reply with \"1\" if the number is lower than the guess,");
    printf("\"2\" if the number is greater than the guess, and \"3\" if the");
    printf(" guess was correct.\nGot it? OK!\n");

    //Set the initial guess to 50
    int guess = 50;
    //Set the number of guesses to 1
    int guesses = 1;
    //Create the array of changes that the computer will make
    int guessArray[] = {0, 25, 13, 7, 4, 2, 1};
    //Create a variable to observe the player's response
    int reply;

    while (1) {
        printf("Is it %i?\n", guess);
        scanf(%i, &reply);
        if (reply = 1) {
            guess = guess + guessArray[guesses];
            guesses++;
            continue;}
        if (reply = 2) {
            guess = guess - guessArray[guesses];
            guesses++;
            continue;}
        if (reply = 2) {
            guesses++;
            break;}
        if (reply != 1 && reply != 2 && reply != 3) {
            printf("Sorry, but that isn't a valid response.");
            continue;}

    getchar();
    return 0;
}
%i should be a string: "%i"
Also, a switch() statement would be more appropriate here than the repeated if statements. I think you'll find that it will make the code clearer.
Topic archived. No new replies allowed.