Help me in solving CLB067 problem

My issue

Why does it keep saying wrong answer

My code

#include <stdio.h>

int main() {
    
    int b, r;
    b = 23, r = 45;

    if (r > b) {
        printf("Rob scored higher marks than Bob.\n");
    } else if (r == b) {
        printf("Bob & Rob both scored the same\n");
    }
    
    b = 15;
    r = 15;

    if (r > b) {
        printf("Rob scored higher marks than Bob.\n");
    } else if (r == b) {
        printf("Bob & Rob both scored the same.\n");
    }

    return 0;
}

Learning course: Learn C
Problem Link: CodeChef: Practical coding for everyone

You have added an extra . (dot) in the 2nd else if statement. It is not required for the 2nd statement.

1 Like