Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

#include<stdio.h>
int main()
{
int i=2;
int j=++i + ++i + i++;
printf("%d\n",i);
printf("%d\n",j);
}

Answer Posted / vadim g

i=5 and j=12

Here is the sequence of operations:
1. i = 2 => result i = 2
2. first ++i => result: i = 3
3. second ++i => result: i = 4
4. j assignment => result: j = 4 + 4 + 4 = 12
5. i post increment => i = 5

MSVC++ gives 5 and 12.

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe how arrays can be passed to a user defined function

1250


Why does notstrcat(string, "!");Work?

1101


What tq means in chat?

1086


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1171


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1064


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

1066


Why is c called a structured programming language?

1233


What is the difference between single charater constant and string constant?

1055


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1979


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1063


What are the advantages and disadvantages of a heap?

1165


How do we make a global variable accessible across files? Explain the extern keyword?

1846


Is malloc memset faster than calloc?

1030


What do you mean by dynamic memory allocation in c? What functions are used?

1128


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1960