This is on C:
#include <stdio.h>
int main()
{
int a=100,b;
b= (a>100)?a++:a--;
printf("%d %d\n",a,b);
}
b assigned the value 100 but when trying
int main()
{
int a=100,b;
b= (a>100)
printf("%d %d\n",a,b);
}
b prints the value 1 as it returns true. why is it different when using '?:' operator?