My issue
could not get what is the question and what will come in output
My code
#include <stdio.h>
int main(void) {
// your code goes here
int b=23;
int r=45;
if(r>b)
{
printf("Rob scored higher marks than bob");
}
else if(b==r)
{
printf("Bob & Rob both scored the same");
}
r=15;
b=15;
if(r>b)
{
printf("Rob scored higher marks than bob");
}
else if(r==b){
printf("Bob & rob both scored the same");
}
return 0;
}
Learning course: Learn C
Problem Link: CodeChef: Practical coding for everyone
@tejasvinik
this question is set to make u understand how if else works .
The question is to compare r and b the print the statement accordingly.
plzz make sure to write exact same statement inside printf.
like this
#include <stdio.h>
int main() {
int r;
int b;
r = 45;
b = 23;
if (r > b) {
printf("Rob Scored higher marks than Bob.\n");
} else if (r == b) {
printf("Bob & Rob both scored the same\n");
}
r = 15;
b = 15;
if (r > b) {
printf("Rob Scored higher marks than Bob.");
} else if (r == b) {
printf("Bob & Rob both scored the same");
}
return 0;
}