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...

what will be the output of this program?
void main()
{
int a[]={5,10,15};
int i=0,num;
num=a[++i] + ++i +(++i);
printf("%d",num);
}

Answer Posted / ricky

Garbage Value

num=a[++i] + ++i +(++i);
in this line the last i will be incremented first
so the last ++i will return 1 after that the middle ++i will return 2 now the value of i will change every where in the program now the first ++i will return 3 since the array starts with a[0] and ends at a[2] there is no a[3] and hence it will print garbage value

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you write the function prototype, definition and mention the other requirements.

1098


What is the most efficient way to count the number of bits which are set in an integer?

1017


simple program of graphics and their output display

1957


write a program to concatenation the string using switch case?

2051


What are the different types of C instructions?

1272


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

1054


what are # pragma staments?

2007


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2144


What is meant by preprocessor in c?

968


What's the best way of making my program efficient?

1050


what do u mean by Direct access files? then can u explain about Direct Access Files?

2053


What is the function of multilevel pointer in c?

1044


Is there a way to jump out of a function or functions?

1053


What are types of functions?

995


How arrays can be passed to a user defined function

981