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

in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

1152


Where are local variables stored in c?

986


a program that can input number of records and can view it again the record

1869


What does a function declared as pascal do differently?

1048


Tell us two differences between new () and malloc ()?

1123


Can you please explain the difference between exit() and _exit() function?

996


What is static function in c?

1070


What is getch c?

1247


In C language what is a 'dangling pointer'?

1065


I have a varargs function which accepts a float parameter?

1002


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2526


What is difference between union All statement and Union?

1062


What is scanf () in c?

1061


What is the total generic pointer type?

1110


Explain enumerated types in c language?

993