#include<stdio.h>
int main()
{
int i=2;
int j=++i + ++i + i++;
printf("%d\n",i);
printf("%d\n",j);
}
Answers were Sorted based on User's Feedback
Answer / vivek patel
it give warning...........
because fun should have return type...
first i=2
then ++i so i=3 and j=3+ ++i + i++
then ++i so i=4 and j=3 + 4 + i++;
then i++ so i=5 and j=3 + 4+ 5;
so i=5 and j=12;
there is no more diff between i++ and ++i in run time..
it gives same ans....
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / ashok reddy
intially i=2
j=++i + ++i + i++;
in this statament it calculates from r-l
so j=5+4+2
and the last value of i is 5
so i=5 and j=11
is the correct answer
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nb
i = 2 (i dont change)
j = 6 (++i = 3 and in i++ increments after calculating j )
| Is This Answer Correct ? | 1 Yes | 6 No |
Why are all header files not declared in every c program?
if the address of a[1,1] and a[2,1] are 1000 and 1010 respectively and each occupies 2 bytes then the array has been stored in what order?
4 Answers Amazon, Apple, Bata, Google, NASA,
ratio,age,persentage
What is a buffer in c?
Explain how can you avoid including a header more than once?
How will you divide two numbers in a MACRO?
difference between my-strcpy and strcpy ?
3 Answers Geometric Software, IIM, Infosys,
how to count no of words,characters,lines in a paragraph.
What is function pointer and where we will use it
Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
In which language linux is written?
What is the heap?