main()
{
printf(5+"good morning");
printf("%c","abcdefgh"[4]);
}the o/p is morning and e...how someone explain
Answer / 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 |
Write a function in c to find the area of a triangle whose length of three sides is given.
What is the size of enum in c?
Write the following function in C. stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
What are different storage class specifiers in c?
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
triangle number finding program...
What are c preprocessors?
Does c have circular shift operators?
what will be the output of "printf("%d%d",scanf("%d% d",&a,&b))".provide an explation regarding the question
How can I manipulate individual bits?
What is n in c?
Difference between constant pointer and pointer to a constant.