void main()
{
int i=5;
printf("%d",i++ + ++i);
}
Answer Posted / vivers
There are two different questions..
in which its asking the result for
1)(i++ + ++i)
answer will be---> 12
"as addition will takes place from left to right
step1: i++ = 5;
step2: value of i will be updated before taking value of
another operand and hence i = 6;
step3: ++i = 7 as first increment will happen and then value
will be used.
final result: 5 + 7 = 12"
2) (i+++++i)
answer will be---> compile error
"because illegal combination of operators"
best of luck...
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain what are the different data types in c?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
all c language question
What are the types of data types and explain?
Disadvantages of C language.
Can you return null in c?
write a program fibonacci series and palindrome program in c
How do we open a binary file in Read/Write mode in C?
What are the different types of linkage exist in c?
What is advantage of pointer in c?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is data structure in c and its types?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
What do the functions atoi(), itoa() and gcvt() do?
I came across some code that puts a (void) cast before each call to printf. Why?