LogiQuest
Back to Control Instructions
19

What will be the output of the program?

#include <stdio.h>

int main(void) {
    int n = 1234, r = 0;
    while (n) { r = r * 10 + n % 10; n /= 10; }
    printf("%d\n", r);
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.