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
Why we not create function inside function.
explain what is a newline escape sequence?
What is the importance of c in your views?
I heard that you have to include stdio.h before calling printf. Why?
Explain how do you convert strings to numbers in c?
When can a far pointer be used?
What is volatile variable in c?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
How the c program is executed?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
Explain how can you be sure that a program follows the ansi c standard?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
How to throw some light on the b tree?
What's the best way of making my program efficient?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?