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 an auto keyword in c?
What is nested structure with example?
What is void pointers in c?
What is output redirection?
What is LINKED LIST? How can you access the last element in a linked list?
What is scanf () in c?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is void c?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Why are all header files not declared in every c program?
Where does the name "C" come from, anyway?
Subtract Two Number Without Using Subtraction Operator
What is pointer & why it is used?
What is d scanf?
How do you use a pointer to a function?