+ 2
What is output and why??
Int x; x=2,3,4,5; Printf("%d",x);
5 Réponses
+ 10
If you lowercased your I the answer is 2.
What happens is that when you declare integers like:
int a, b, c, d;
a, b, c, d are all integer typed.
What if you want to assign a value?
int a=8, b, c, d=5;
Now what if you forget to store some variables?
int x = 2, {y=} 3, {z=} 4;
Here, imagine inserting a fictitious y and z and this whole statement makes sense.
Seriously that 3, 4, 5 are all useless and you don't need them.
+ 13
Think you've encountered this question in the C challenges. Think you've got the answer but there was another question which is similar and I wanted to discuss it with you.
{Int x;
x=(2,3,4,5);
Printf("%d",x);}
Unlike your question this program outputs : 5
Because braces have been used.
+ 8
It would be preferred if you ran these sort of codes in a C compiler.
+ 6
First come first serve buddy 2 is first line hence it has the right to be the answer of this snippet 😅
+ 3
First assignment i.e. 2 will be output.
You could give a try by yourself in c compiler.