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

Answers were Sorted based on User's Feedback



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

Answer / sangeetha

the inner printf statement will print Hello but the outer
printf is %d it will print an integer but we didnt call the
value it will give u the garbage value.and the output of the
program will be hello5.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / sreenivasulu buddhala

It returns Hello5.since the inner printf been called
first,it would return the number of characters printed
successfully.so the result is Hello5

Is This Answer Correct ?    1 Yes 0 No

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

Answer / peddivinodkumarchowdary

hello5

Is This Answer Correct ?    1 Yes 0 No

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

Answer / kuldeep vishwakarma

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

ans: Hello5


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

ans: Hello5

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

ans: function call missing )
(because end parenthesis is not close)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / vipin sharma

it will return hello 51

Is This Answer Correct ?    0 Yes 0 No

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

Answer / milan

it will return hello5,firstly the inner printf executes
print the hello and return the number of characters printed
that is 5 which get printed by outer printf...
More info at:
http://clanguagestuff.blogspot.com/2011/02/what-printf-returns.html

Is This Answer Correct ?    0 Yes 0 No

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

Answer / atul shukla

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

result is for sure hello5
anywhere if braces () are used it uses stack to perform its
operation last open braces will sort first and
print 'hello'and printf return int value its protype is
int printf(const char *format [,argument,...]);
value return will be length of string thats 5
u can change hello to any other string it will print lenght
of string only

Is This Answer Correct ?    0 Yes 0 No

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

Answer / mayur patil

answer is hello 11

Is This Answer Correct ?    0 Yes 0 No

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

Answer / soupal roy

hello4

Is This Answer Correct ?    1 Yes 2 No

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

Answer / karna

hello5

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

What does the message "warning: macro replacement within a string literal" mean?

1 Answers  


Taking an example,differentiate b/w loader and linker ?

1 Answers  


#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared like DCHAR ch1, ch2; TCHAR ch3, ch4; then what will be types of ch1, ch2, ch3 and ch4?

6 Answers   NDS,


What is the difference between ++a and a++?

0 Answers  


code for concatination of 2 strings with out using library functions?

3 Answers  






which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

0 Answers  


What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }

5 Answers   ADITI, Wipro,


Function to find the given number is a power of 2 or not?

20 Answers   Motorola, nvidia,


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

0 Answers  


What is auto keyword in c?

0 Answers  


print 1-50 with two loop & two print Statement

2 Answers  


What is calloc in c?

0 Answers  


Categories