why do some people write if(0 == x) instead of if(x == 0)?
Answer / Yogendra Pratap Singh
Some developers write if(0 == x) to make the code easier to read, as it's clear that you're testing for zero and not accidentally comparing a variable to an unknown value. In C, both expressions are equivalent.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is string function c?
code snippet for creating a pyramids triangle ex 1 2 2 3 3 3
Why c is called a middle level language?
What is the real difference between arrays and pointers?
27 Answers Hexaware, Logic Pro, TCS,
char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)
main() { intj; while9j<=10) { printf("\n%d",j); j=j+1; } }
Write a program for Overriding.
n=7623 { temp=n/10; result=temp*10+ result; n=n/10 }
who developed c and why he developed c?
What are keywords in c with examples?
Why cd or dvd are round why not square.
When should a type cast not be used?