main()
{ int i=5;
printf("%d",++i + i);
} output is 10
------------------------
main()
{ int i=5;
printf("%d",i++ + i);
}output is 12
why it is so? give appropiate reason....
Answer Posted / ashi smita
in first program i is post increment than i=5 and i=5+5=10
than i is increment by 1 and the value of i is 6 but second
program first i is preincrement by 1 and the value of is 6
than sum of i is 12.
Is This Answer Correct ? | 3 Yes | 10 No |
Post New Answer View All Answers
How many types of operator or there in c?
What is return in c programming?
What is the scope of an external variable in c?
What is double pointer?
Why can’t we compare structures?
What are the different types of objects used in c?
How do you initialize pointer variables?
What is a lvalue
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What do you mean by Recursion Function?
Explain what is the concatenation operator?
How do you declare a variable that will hold string values?
Do you know null pointer?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
What does 4d mean in c?