C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - General Questions (Q.No. 2)
2.
What are the types of linkages?
Answer: Option
Explanation:
External Linkage-> means global, non-static variables and functions.
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.
Discussion:
95 comments Page 7 of 10.
Santosh said:
1 decade ago
@Nagaraj.
I think you have defined means %d so floating part its not showing 0. 00000, print it using %f you will get right answer.
I think you have defined means %d so floating part its not showing 0. 00000, print it using %f you will get right answer.
Shibu said:
1 decade ago
@raju.... begin from the right most(x++).
x++ -> value remains 2,
now ++x -> 2 incremented to 3. now x contains the final value 3
hence z=3+3
=6
x++ -> value remains 2,
now ++x -> 2 incremented to 3. now x contains the final value 3
hence z=3+3
=6
Raju said:
1 decade ago
What's is answer for this question:z=(++x)+(x++), if x=2?
Keerthi said:
1 decade ago
Apple,U said right. but easiest way for shwetha
Here
z=(++x)+(++x)
For 1st ++x,the value of x is first increased about one and then assign ,that means the value of x changes from 5 to 6.
Its clear in the same way the 2 nd ++x, x changes from 6 to 7
So, final value of x is 7
That means z=x+x
For 1st and 2nd x's the value is same that is 7
Therefore
Z=7+7
=14.
Here
z=(++x)+(++x)
For 1st ++x,the value of x is first increased about one and then assign ,that means the value of x changes from 5 to 6.
Its clear in the same way the 2 nd ++x, x changes from 6 to 7
So, final value of x is 7
That means z=x+x
For 1st and 2nd x's the value is same that is 7
Therefore
Z=7+7
=14.
Apple said:
1 decade ago
@shwetha
inc/dec operator has high precedence than arithmatic operators in operator precedence.so,when x=5,
z=(++x)+(++x)
++x => x=6
and
++x => x=7(as x is a variable that can store only a single value)
now,arithmatic operation is performed on it,ie,
z=7+7
z=14
inc/dec operator has high precedence than arithmatic operators in operator precedence.so,when x=5,
z=(++x)+(++x)
++x => x=6
and
++x => x=7(as x is a variable that can store only a single value)
now,arithmatic operation is performed on it,ie,
z=7+7
z=14
Shwetha said:
1 decade ago
@Dixn.
How at end it became 7?
I didn't understand. Can you explain again please.
How at end it became 7?
I didn't understand. Can you explain again please.
Anjesh kumar maurya said:
1 decade ago
Tell me about linkage?
Nagaraj said:
1 decade ago
fmod(3.14,2.1) is giving o/p: 0.000000 why?
Manisha said:
1 decade ago
What are linkage?
Nidhi gupta said:
1 decade ago
What is static and non-static variables?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers