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

main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++;
printf("%d", num[i]);
}

what will be the output?
}

Answer Posted / tk

Answer is :: 3

Explanation::

main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++; // Here i = 1, so num[1] = 1; and num =
{1,1,3,4}
// After the execution of this statement the value of i
will be 2 (as i++)
printf("%d", num[i]); // num[2] = 3 so answer is 3
}
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is main () in c language?

1133


How can I convert a number to a string?

1193


What is the difference between malloc() and calloc() function in c language?

1081


Can you subtract pointers from each other? Why would you?

962


How can you convert integers to binary or hexadecimal?

1037


Write a program for Overriding.

1160


Why is c called c not d or e?

1101


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1090


What is the advantage of a random access file?

1203


How can I pad a string to a known length?

1034


What Is The Difference Between Null And Void Pointer?

1259


Explain how does flowchart help in writing a program?

1119


What is the c language function prototype?

1086


What is the use of pragma in embedded c?

1060


When do we get logical errors?

1125