0
What is the output ?
int a=2,b=4; printf("%d",a&&b);
6 Respuestas
+ 3
Depends on the programming language, it could be a syntax error.
Have you actually tried to run it yourself?
+ 3
...and you still have not answered to either of my follow-up questions:
1. Which programming language?
2. Have you tried running it, and what did you experience?
+ 3
In C language, your code is failing with error, because there is no print function.
If you use printf, the result is 1.
&& is the logical "and" operator.
Both a and b are positive numbers which have a truthy value, therefore "a and b" is also true.
The %d format specifier converts "true" to numeric value which is 1. The numeric value of false would be 0.
+ 3
If you want to know WHAT the output is, do the following:
Go to Code section, click +, select the programming language, insert your code, click Run.
If you want to know HOW OR WHY the output is, please make that clear in your question.
0
its not an error just try to answer how the code runs
0
c language