🚀 Learn 90+ coding courses & crack 200+ competitive exams — powered by learning intelligence on Leyaa.ai →

printf(5 + "good morning");

"good morning" is a character array.

If we assume base address of the character array "good morning" as 1024.

The starting address points to the character 'g'.




5 + "good morning" or "good morning" + 5

5 + "good morning" will be (base address + 5 which is 1029.(size of character is 1 byte.)

Now the starting address is 1029 which points the character 'm'.


5 + good morning

printf will print the given message from the starting address to the end.

Here, starting address has changed to 1029.

So, it will print "morning"


#include<stdio.h>

int main()
{
    printf(5 + "good morning");

    return 0;
}

Output

morning


🚀 One platform. 90+ coding courses. 200+ exams.

From programming fundamentals to competitive exam prep — learn with intelligence, not just content. Free on Leyaa.

Explore Leyaa.ai Free →