fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. char *str1 = "cat";
  5. char *str2 = "dog";
  6.  
  7. // The result of a logical operation (||) is always 0 or 1
  8. int str3 = (str1 || str2);
  9.  
  10. printf("%d", str3); // Output: 1
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
1