8

What is the output?????

Comments
  • 9
    A] 543
  • 1
    @mourad looks like it
  • 6
    This is the number one reason I dread taking CS at school.

    I understand every bit of this code. But I don't understand where one language will throw, say, a type error (cannot convert int to string) and another won't. My answers on a test will reflect this because I know too many languages for my own good.
  • 2
    @chadd17 there isn't any conversion in this! The answers are either:
    543
    54
    5
    Null

    There isn't any int to string conversion. The cout << operator accepts an int as an argument and will print them without converting to string
  • 0
    @Cyberhax how long have you been programming? 🤔
  • 1
    @VirtualProtect it's details like that I would miss on a test cause I would get it confused with other functions and languages that operate differently. That's my point.
  • 7
    @Cyberhax Do your own homework.
  • 1
  • 1
    This is a bit too easy. Why do people seem to find basic C complicated?
    This is just like a for loop in every other language.

    The bizarre part is including iostream instead of stdio.h.

    If you are including C++ headers, may as well use other C++ features too.
  • 0
    @Faraaz about 3.5 years
  • 0
    @globalvariable its not my homework...
    Okay..
  • 0
    Null
  • 0
    The output is: you fucking wanker who wrote this code, fuck off. Do not write over cinplicated shit code like that.
  • 0
    @F9lke
    Why null ?
  • 0
    D] null

    Because NULL == 0 and the return code is 0
    ;)
  • 0
    @CraftedCart also this ambiguity
  • 1
    @CraftedCart
    543 has already been outputted before reaching the return point.
Add Comment