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 cohesion in c?

981


What is echo in c programming?

1018


What are global variables?

1181


What tq means in chat?

1122


What is the use of #include in c?

1081


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1074


What is the difference between array and pointer in c?

1159


Write a code to determine the total number of stops an elevator would take to serve N number of people.

1256


while initialization of array why we use a[][2] why not a[2][]...?

2358


What language is lisp written in?

1258


Differentiate fundamental data types and derived data types in C.

1033


Explain the difference between structs and unions in c?

1020


what is different between auto and local static? why should we use local static?

1124


What is 2 d array in c?

1021


How do I send escape sequences to control a terminal or other device?

1070