ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
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
 
Is This Answer Correct ?    3 Yes 16 No
Rajesh
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 2
printf("%d",(printf("Hello")));

Result is    Hello5
 
Is This Answer Correct ?    26 Yes 2 No
Aju.b
 
 
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 3
5

Printf() return number character print on STD::out
 
Is This Answer Correct ?    5 Yes 7 No
Srinivasa. P
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 4
Hello5

Printf() return number character print on STD::out
 
Is This Answer Correct ?    6 Yes 3 No
Srinivasa. P
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 5
1

Printf() return number character print on STD::out
 
Is This Answer Correct ?    1 Yes 9 No
Srinivasa. P
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 6
int
 
Is This Answer Correct ?    0 Yes 8 No
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.
 
Is This Answer Correct ?    0 Yes 7 No
Praneeth
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 8
104
 
Is This Answer Correct ?    0 Yes 8 No
Bhavesh Kashikar
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 9
072
 
Is This Answer Correct ?    1 Yes 8 No
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
 
Is This Answer Correct ?    11 Yes 1 No
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
 
Is This Answer Correct ?    1 Yes 7 No
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
 
Is This Answer Correct ?    2 Yes 6 No
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
 
Is This Answer Correct ?    8 Yes 1 No
Anil Kumar
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 14
5 , Hello
 
Is This Answer Correct ?    3 Yes 6 No
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.
 
Is This Answer Correct ?    3 Yes 4 No
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.
 
Is This Answer Correct ?    4 Yes 2 No
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
 
Is This Answer Correct ?    0 Yes 5 No
Vignesh1988i
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 18
error bcz 1 bracket is missing.
if corected
output will b

Hello5
 
Is This Answer Correct ?    4 Yes 1 No
Varun
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 19
printf function returns the number of character it prints
so output:Hello5
 
Is This Answer Correct ?    1 Yes 0 No
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
 
Is This Answer Correct ?    0 Yes 0 No
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.
 
Is This Answer Correct ?    0 Yes 0 No
Dally
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 22
an Error will occur....bcos the function call is missing in 
main().
 
Is This Answer Correct ?    0 Yes 1 No
Anonymous
 
  Re: printf("%d",(printf("Hello")); What it returns?
Answer
# 23
hello5
 
Is This Answer Correct ?    0 Yes 0 No
Peddivinodkumarchowdary
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output?? Ramco13
what is the advantage of using SEMAPHORES to ORDINARY VARIABLES??? NSN1
WAP to convert text into its ASCII Code and also write a function to decode the text given?  2
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } ME5
for(i=0;i=printf("Hello");i++); printf("Hello"); how many times how will be printed?????????  4
How to write a program for swapping two strings without using 3rd variable and without using string functions. iGate5
Explain in detail how strset (string handling function works )pls explain it with an example.  1
Write code for finding depth of tree Adobe1
Describe advantages and disadvantages of the various stock sorting algorithms Microsoft1
How to implement variable argument functions ? HP1
what is the difference between const char *p, char const *p, const char* const p Accenture4
Which command is more efficient? *(ptr+1) or ptr[1]  3
how to implement stack work as a queue?  2
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator?? Verifone8
difference of two no's with out using - operator  6
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } CitiGroup7
Write a program to write a given string in maximum possibilities? i.e str[5]="reddy"; i.e we can write this string in 120 ways for that write a program Subex3
value = 0xabcd; for (loop = 1; (value >> 1) & 1 | loop & 1; loop++) { foo(); if (loop & 1) value >>= 1; } how many times is foo() executed? Google5
what is the use of keyword volatile?? LG-Soft4
Can we include one C program into another C program if yes how? Infosys4
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com