51
Which operator from the following has the lowest priority?
Learn competitive and Technical Aptitude C programming mcq questions and answers on Operators and Expressions with easy and logical explanations. Page-6 section-1
void main()
{
int w=10, x=5, y=3, z=3;
if( (w < x ) && (y=z++) )
printf("%d %d %d %d", w, x, y, z);
else
printf("%d %d %d %d", w, x, y, z);
} As the expression is evaluated from right to left.
void main()
{
int a=10, b;
b = a++ + ++a;
printf("%d %d %d %d", b, a++, a, ++a);
}
a with the value 10.b without initialization (the initial value is undefined).a++ (post-increment): - The current value of a is 10. - After evaluating a++, a becomes 11.++a (pre-increment): - ++a increments a to 12 and returns the updated value, which is 12.b.printf function follows the stack Last-In-First-Out (LIFO) concept, which means that the expressions are evaluated from right to left.++a: - ++a increments a to 13 and returns the updated value, which is 13.a++: - a++ returns the current value of a (13) and then increments a to 14. - The returned value is 13.a, which has the current value of 14.22 13 14 14b, followed by the evaluated values of a++, a, and ++a, respectively, in the printf statement.
#include <stdio.h>
int main()
{
float a = 2.455555555555;
printf("%f", a);
} union temp
{
char a;
int b;
float c;
};