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
What is memcpy() function?
Can we access array using pointer in c language?
What is oops c?
define string ?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
Why do we write return 0 in c?
Explain how can I avoid the abort, retry, fail messages?
What are the rules for identifiers in c?
Explain main function in c?
What are the benefits of c language?
Explain how does flowchart help in writing a program?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
Can include files be nested?
Write a Program to accept different goods with the number, price and date of purchase and display them
What is c value paradox explain?