C Programming - Strings - Discussion

Discussion Forum : Strings - Find Output of Program (Q.No. 4)
4.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    printf(5+"Good Morning\n");
    return 0;
}
Good Morning
Good
M
Morning
Answer: Option
Explanation:

printf(5+"Good Morning\n"); It skips the 5 characters and prints the given string.

Hence the output is "Morning"

Discussion:
12 comments Page 2 of 2.

Moni Gupta said:   4 years ago
Skip 5 that means till m then why print morning it should be orning.

Sanjeev said:   1 decade ago
5+ means what?


Post your comments here:

Your comments will be displayed after verification.