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

int main()
{
int x = (2,3,4);
int y = 9,10,11;
printf("%d %d",x,y);
}
what would be the output?

Answer Posted / vadivelt

1.Error. Because the syntax of statement int y = 9,10,11;
is wrong. it is not allowed to initialise a variable "int y
= 9,10,11;" with this syntax because it will be treated as
constant. But it is allowed to keep the values inside of
braces in the initialisation. ie., int x = (2,3,4);

2.If the program is written as like below, output would be
4 9.

int main()
{
int x, y;
x = (2,3,4);
y = 9,10,11;
printf("%d %d",x,y);
getch();
}

Cos the precedence of statement x = (2,3,4); is left to
right. and for y = 9,10,11; the precedence would be right
to left.

So the latest assigned values to x and y would be 4 and 9.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a null pointer in c?

1124


What are the similarities between c and c++?

1002


What is double pointer?

950


What is the advantage of a random access file?

1129


How can I do peek and poke in c?

1038


What is "Hungarian Notation"?

1033


Find MAXIMUM of three distinct integers using a single C statement

1014


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2008


Explain what are reserved words?

1041


Explain pointers in c programming?

1063


What does c mean before a date?

1104


Stimulate calculator using Switch-case-default statement for two numbers

2922


What is the purpose of void pointer?

986


What is cohesion in c?

923


What is a pragma?

1078