printf("%d",(printf("Hello")); What it returns?

Answers were Sorted based on User's Feedback



printf("%d",(printf("Hello")); What it returns? ..

Answer / aju.b

printf("%d",(printf("Hello")));

Result is Hello5

Is This Answer Correct ?    175 Yes 15 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / vikas pawar

printf("%d",(printf("Hello"));


Result is Hello5
Inner printf prints Hello and outer printf gives length of
string i.e. 5

Is This Answer Correct ?    69 Yes 8 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / srinivasa. p

Hello5

Printf() return number character print on STD::out

Is This Answer Correct ?    30 Yes 10 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / anil kumar

Result is Hello5
Inner printf prints Hello and outer printf gives length of
string i.e. 5

Is This Answer Correct ?    14 Yes 2 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / amit shrivastava

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.

Is This Answer Correct ?    10 Yes 2 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / varun

error bcz 1 bracket is missing.
if corected
output will b

Hello5

Is This Answer Correct ?    12 Yes 4 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / anupam sen

printf function returns the number of character it prints
so output:Hello5

Is This Answer Correct ?    5 Yes 0 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / vivek_akathara

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.

Is This Answer Correct ?    7 Yes 4 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / dally

It will print hello with length of 5.Because return value of
printf is length of that string.

Is This Answer Correct ?    2 Yes 0 No

printf("%d",(printf("Hello")); What it returns? ..

Answer / dinesh gupta

error
bcos one bracket is missing
if make correction
then out put is ........ hello5
reason..inner statement print hello and as wellas returns the lenth of the string to outer print statement,which give 5

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

Can a pointer be volatile in c?

0 Answers  


How to add two numbers with using function?

4 Answers  


Write an implementation of “float stringToFloat(char *str).” The code should be simple, and not require more than the basic operators (if, for, math operators, etc.). • Assumptions • Don’t worry about overflow or underflow • Stop at the 1st invalid character and return the number you have converted till then, if the 1st character is invalid return 0 • Don’t worry about exponential (e.g. 1e10), instead you should treat ‘e’ as an invalid character • Write it like real code, e.g. do error checking • Go though the string only once • Examples • “1.23” should return 1.23 • “1a” should return 1 • “a”should return 0

6 Answers   Qualcomm,


What is the most efficient way to count the number of bits which are set in a value?

4 Answers  


I use turbo C which allocates 2 bytes for integers and 4 bytes for long. I tried to declare array of size 500000 of long type using the following code... long *arr; arr=(long *)(malloc)(500000 * sizeof(long)); It gives a warning that "Conversion may lose significant digits in function main"... And the resulting array size was very less around 8400 as compared to 500000. Any suggestions will be welcomed....

2 Answers  






what defference between c and c++ ?

6 Answers  


main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }

2 Answers  


write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

7 Answers  


WHAT IS HEADER?

8 Answers   ProKarma, TCS,


There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?

8 Answers   Google,


What are the advantages of using linked list for tree construction?

0 Answers  


What is #line used for?

0 Answers  


Categories