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 |
What are the uses of pre-processor directives?
Derive the complexity expression for AVL tree?
Write a c program using for loop to print typical pattern if number of rows is entered by keyboard. ABCBA AB BA A A
For what purpose null pointer used?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
Can we assign integer value to char in c?
How can I do peek and poke in c?
Should I learn data structures in c or python?
What is the output of the program given below #include<stdio.h> main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
21 Answers ADITI, Student, TCS,
What is 'bus error'?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
Can you think of a way when a program crashed before reaching main? If yes how?