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 4 of 10.
Moumita said:
1 decade ago
Guys please check this once more.
When x =5 then,
Z=++x + ++x;
Is printing 13 not 14....
So what is the actual explanation?
When x =5 then,
Z=++x + ++x;
Is printing 13 not 14....
So what is the actual explanation?
Kavitha said:
1 decade ago
#include<stdio.h>
int main()
{
int x=3;
int z;
z=++x + x++;
printf("%d",z);
}
It gives the output 9,how?
int main()
{
int x=3;
int z;
z=++x + x++;
printf("%d",z);
}
It gives the output 9,how?
Mounika said:
1 decade ago
13 because here first x = 5.
Then ++x = 6(pre increment).
Now x = 6.
Then ++x = 7.
So z = ++x + ++x.
z = 6+7 => 13.
Then ++x = 6(pre increment).
Now x = 6.
Then ++x = 7.
So z = ++x + ++x.
z = 6+7 => 13.
Geetha said:
9 years ago
#include <stdio.h>
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
}
Output = 6.
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
}
Output = 6.
Vineethreddy said:
7 years ago
Pre increment - increment the value and then use it.
Post increment - use the value and then increment.
Post increment - use the value and then increment.
Keerthana said:
8 years ago
Pre increment - increment the value and then use it.
Post increment - use the value and then increment.
Post increment - use the value and then increment.
Sagar Prakash pakhale said:
7 years ago
Pre-increment - increment the value and then use it.
Post-increment - use the value and then increment.
Post-increment - use the value and then increment.
Lavanya said:
8 years ago
Can anyone tell me the difference between static and non-static variables? and also about linkages.
Anitha said:
1 decade ago
How can we print a string without using printf() and any other functions like puts() & get() ?
Nali srikanth said:
6 years ago
Static variable is a fixed.
Non static variable can be changed.
None linkage means local variable.
Non static variable can be changed.
None linkage means local variable.
(6)
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers