#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 |
What is abstract data structure in c?
can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?
How will you find a duplicate number in a array without negating the nos ?
main() { static char *s[]={"black","white","yellow","voilet"}; char **ptr[]={s+3,s+2,s+1,s}, ***p; p=ptr; **++p; printf("%s",*--*++p+3); }
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Differentiate between calloc and malloc.
What is RAM memory? and What is ROM?Who designed one is temparary and another is permanent?why they designed like that?By using far pointer which type data(whether hexadecimal)we can access?
char *p="name"; printf(p);
Explain how do you print an address?
What is adt in c programming?
What does the file stdio.h contain?
Why the use of alloca() is discouraged?