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


Please Help Members By Posting Answers For Below Questions

How many types of operator or there in c?

593


What is return in c programming?

503


What is the scope of an external variable in c?

561


What is double pointer?

554


Why can’t we compare structures?

801






What are the different types of objects used in c?

566


How do you initialize pointer variables?

600


What is a lvalue

655


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

1897


What do you mean by Recursion Function?

625


Explain what is the concatenation operator?

615


How do you declare a variable that will hold string values?

659


Do you know null pointer?

596


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.

1653


What does 4d mean in c?

932