C Programming - Expressions - Discussion
Discussion Forum : Expressions - General Questions (Q.No. 4)
4.
Which of the following is the correct order if calling functions in the below code?
a = f1(23, 14) * f2(12/4) + f3();
a = f1(23, 14) * f2(12/4) + f3();
Answer: Option
Explanation:
Here, Multiplication will happen before the addition, but in which order the functions would be called is undefined. In an arithmetic expression the parenthesis tell the compiler which operands go with which operators but do not force the compiler to evaluate everything within the parenthesis first.
Discussion:
12 comments Page 2 of 2.
Subrat said:
8 years ago
int x=3,y=5,p=10,z;
z = (x>y)||(x==0)&&(y<<1);
printf("%d",z);
Value of z is 0.
z = (x>y)||(x==0)&&(y<<1);
printf("%d",z);
Value of z is 0.
(1)
Akash c said:
4 years ago
Logic operators always tell true or false. if it false, then ans =0 if it's right then ans =1.
I think the answer will be 0!!!
Is it correct?
I think the answer will be 0!!!
Is it correct?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers