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 |
how to construct a simulator keeping the logical boolean gates in c
What is #define in c?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h"
What does static mean in c?
Go through this linked list concept.While traversing through the singly linked list sometimes the following code snippet "while(head != NULL)" is used and other times "while(head->link != NULL)"is used(Here head is the pointer pointing to the first node,node has two parts data part and link part).What is the difference between head != NULL and Head->link != NULL and in which situation are they used?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
what information does the header files contain?
6 Answers BSNL, Cisco, GDA Technologies,
How can I trap or ignore keyboard interrupts like control-c?
What is Dynamic Initialization.
Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?
wtite a program that will multiply two integers in recursion function