mercredi 31 mars 2021

Solving a problem using logical operators in C programming language


#include <stdio.h>


void main()
{
 int a = 11, b = 5;
 if(a == 7 || 10){
     printf("True");
 }
 else
 printf("False");
}

This is my problem, i saw it in a question and was asked what the output would be. i put false but the answer was true, im trying to understand why because a is not equal to any of them and the condition for it to be true is that a be equal to at least one of them

Aucun commentaire:

Enregistrer un commentaire