Question
printf("%d",(printf("Hello")); What it returns?
Question Submitted By :: Radhika
I also faced this Question!!
Rank
Answer Posted By
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 1
0
Rajesh
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 2
printf("%d",(printf("Hello")));
Result is Hello5
Aju.b
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 3
5
Printf() return number character print on STD::out
Srinivasa. P
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 4
Hello5
Printf() return number character print on STD::out
Srinivasa. P
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 5
1
Printf() return number character print on STD::out
Srinivasa. P
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 6
int
Srinivasa. P
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 7
It doesn't because in printf access specifier is Integer
but to display Hello we should use %s.
Praneeth
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 8
104
Bhavesh Kashikar
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 9
072
Bhavesh Kashikar
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 10
printf("%d",(printf("Hello"));
Result is Hello5
Inner printf prints Hello and outer printf gives length of
string i.e. 5
Vikas Pawar
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 11
error will occur because within a printf statement another
printf statement is present
Pavithra
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 12
prinf execution starts from right to left so it will prints
hello &here printf is taken as a function, it returns int
value as len of srting is 5.it does'nt count /0
S.veena Bhargavi
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 13
Result is Hello5
Inner printf prints Hello and outer printf gives length of
string i.e. 5
Anil Kumar
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 14
5 , Hello
Raks
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 15
if the statement is as shown above then it will show an
error due to incomplete parentheses(there are 3 opening and
2 closing)
once that is corrected then you will get the output as
hello5 for the reasons explained above.
Vivek_akathara
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 16
it will show hello5
hello from the inner printf and 5 value return by the outer
printf function,as printf return int value of the string
and in the example there is 5 wrds so the lenght is 5 which
it return.
Amit Shrivastava
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 17
the printf fun() always writterns the numbeer of characters
...... so 5 is o/p
Vignesh1988i
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 18
error bcz 1 bracket is missing.
if corected
output will b
Hello5
Varun
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 19
printf function returns the number of character it prints
so output:Hello5
Anupam Sen
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 20
It returns Hello5.since the inner printf been called
first,it would return the number of characters printed
successfully.so the result is Hello5
Sreenivasulu Buddhala
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 21
It will print hello with length of 5.Because return value of
printf is length of that string.
Dally
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 22
an Error will occur....bcos the function call is missing in
main().
Anonymous
Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 23
hello5
Peddivinodkumarchowdary