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?

Answers were Sorted based on User's Feedback



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

Answer / samrat

Ans is: 4,9

For example

int i = (x, y); // stores y into i
int i = x, y; // stores x into i

Is This Answer Correct ?    5 Yes 1 No

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

Answer / hemant kumar

error

Is This Answer Correct ?    6 Yes 2 No

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

Answer / 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

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

Answer / saranya

you cant initialize values separated by commas for the variables,it may cause errors .so find to initialize properly before setting the values to the variables.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / kalyan chukka

in This Given x=(2,3,4) which takes priority from left->right
and given y=9,10,11 So in This it takes priority from right
-> left so answers are

X=4
Y=9

Is This Answer Correct ?    1 Yes 1 No

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

Answer / ajay kumar

error:
because declaration terminated incorrectly.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / yatish m yadav

x=4 and y=9

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Interview Questions

what different between c and c++

1 Answers  


What is assignment operator?

0 Answers  


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

0 Answers  


What is Memory leakage ?

2 Answers   HCL,


What is %s and %d in c?

0 Answers  


What is the main differences between C and Embedded C?

9 Answers  


What is a memory leak in structures? How can we rectify that?

2 Answers  


Can you think of a way when a program crashed before reaching main? If yes how?

2 Answers  


What does %d do?

0 Answers  


What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }

9 Answers   CTS, Wipro,


Explain Basic concepts of C language?

0 Answers   EXL,


how can i get output the following... 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 and 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 plz plz...

3 Answers  


Categories