51
anth12
8y

for(int i = 0; i < 3; i++) {
Write("Happy birthday " + (i == 2 ? "Dear devRant!" : "to you"));
}

Comments
  • 9
    Should be i < 4
  • 0
    As it is your birthday devRant I will use powershell opposed to bash...

    1..4 | % {if ($_ -ne 3) {Write-Host "Happy Birthday to You!"} else {"Happy Birthday Dear devRant"}}
  • 4
    Indeed @josephnasr, i meant <= 😝
  • 9
    Lets see how many different languages we can do...

    HAI 1.3
    LOL VAR R 3
    IM IN YR LOOP
    VISIBLE "Happy Birthday"!
    IZ VAR LIEK 1?
    YARLY
    VISIBLE "Dear devRant"!
    NOWAI
    VISIBLE "to you"!
    KTHX
    NERFZ VAR!!
    IZ VAR LIEK 0?
    GTFO
    KTHX
    KTHX
    KTHXBYE
  • 3
    new Array(4).fill("Happy birthday ").map(function (t, i) { return (i!=2)?t+"to you!":t+"dear DevRant!"; }).join("\n")
  • 3
    #include <stdio.h>

    #define HAPPY_BIRTHDAY "Happy birthday"
    #define TO_YOU "to you"
    #define DEAR_DEVRANT "Dear devRant"

    typedef struct HappyBirthday_t
    {
    const char *start;
    const char *end;
    }HappyBirthday;

    static const HappyBirthday happy_birthday_song[] = {
    { HAPPY_BIRTHDAY, TO_YOU },
    { HAPPY_BIRTHDAY, TO_YOU },
    { HAPPY_BIRTHDAY, DEAR_DEVRANT },
    { HAPPY_BIRTHDAY, TO_YOU },
    { NULL, NULL }
    };

    int main(void)
    {
    const HappyBirthday *s = happy_birthday_song;
    while(s->start) {
    printf("%s %s\n", s->start, s->end);
    s++;
    }
    return 1;
    }
  • 1
    Me too! March 15th 🎉🎉🎉🎉😀🎂🎂🎂🎂🎂🎂🎂🎂🎂🎂🎂
  • 1
    for(var i=0; i<4; i++)
    document.write("Happy Birthday" +
    (i == 2)?" Dear devRant.": " to you.");
  • 0
    for (0..3) {print "Happy Birthday "; $_ = $_ == 2 ? "dear DevRant!": "to you!"; print $_."\n"}
  • 0
    for x in range(3):
    print("Happy Birthday ", end="")
    if x==1:
    print("dear Devrant"!)
    else:
    print("to you!")
Add Comment