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
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 |
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 |
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 |
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 |
Answer / ajay kumar
error:
because declaration terminated incorrectly.
| Is This Answer Correct ? | 1 Yes | 1 No |
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
how to get the starting address of file stored in harddisk through 'C'program.
What is omp_num_threads?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What is calloc()?
Why we use break in c?
what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.
How to print "I Love My India" without using semi colon?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }
Can you assign a different address to an array tag?
How do you do dynamic memory allocation in C applications?
what is the purpose of the code, and is there any problem with the code? int f( int n, int l, int r ) { return (n << l) >> r; }