In both C and C++ language, any non-zero value is treated as true
. In if
condition you are assigning 4
and 0
to a
and b
causing the value of expressions a = 4
and b = 0
to be 4
and 0
respectively.
More Related Contents:
- Segmentation Fault in a brief amount of code
- comments longer than one line
- How to write if condition in while loop to terminate it
- Why this C code makes infinite loop?
- Assignment makes pointer from integer without a cast and vice versa in c
- No out of bounds error
- Passing by reference in C
- returning a local variable from function in C [duplicate]
- How to do scanf for single char in C [duplicate]
- About Tentative definition
- Is errno thread-safe?
- How does an uninitiliazed variable get a garbage value?
- Difference between const & const volatile
- how to control popen stdin, stdout, stderr redirection?
- How to get MAC address of your machine using a C program?
- How to get 100% CPU usage from a C program
- What is the simplest way to write to stdout in binary mode?
- Makefile to compile multiple C programs?
- What does “control reaches end of non-void function” mean?
- Parenthesis surrounding return values in C
- What is Undefined Behaviour in C? [duplicate]
- Is it necessary to reset the fd_set between select system call?
- What’s the difference between array and &array?
- C restore stdout to terminal
- Printing pointers in C
- Find size of array without using sizeof
- How do I get tcsetpgrp() to work in C?
- How to compute 2⁶⁴/n in C?
- How to fgets() a specific line from a file in C?
- Where do malloc() and free() store allocated sizes and addresses?