main()
{
printf(5+"good morning");
printf("%c","abcdefgh"[4]);
}the o/p is morning and e...how someone explain
Answer Posted / vignesh1988i
the o/p depends upon the compiler and cant be predicted
wat's hapenning inside .... each will have different
opinion.....my opinion is :
here in the first printf statement "good morning" acts as
an string and 5+"good morning" means print the string
after the 5th character in the string starting from 0....
so o/p is :
morning
for second one :
this printf can be re-written as the first printf statement
printf("%c",4+"abcdefgh");
here only the 4th character will get printed ... in this
case it will print 'e'..
thank u
| Is This Answer Correct ? | 26 Yes | 11 No |
Post New Answer View All Answers
Write a program to print factorial of given number using recursion?
Write a program to reverse a given number in c?
Is fortran faster than c?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
What is c value paradox explain?
What is cohesion in c?
What is the significance of an algorithm to C programming?
Why static is used in c?
write a c program in such a way that if we enter the today date the output should be next day's date.
Ow can I insert or delete a line (or record) in the middle of a file?
Can a pointer point to null?
What are near, far and huge pointers?
Is c a great language, or what?
How can I remove the trailing spaces from a string?
What are data types in c language?