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;
}
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.
Deepak said:
4 years ago
After skipping a+5=0+5=5 It returns the pointer as 6...And 6th letter is 'M'.
Note: Space should be count.
4+1(space).
Note: Space should be count.
4+1(space).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers