ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2266)
 C++ interview questions  C++ Interview Questions (1121)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (652)
Question
what will be the output of "printf("%d%d",scanf("%d%
d",&a,&b))".provide an explation regarding the question
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
i think it will print the 2, and some garbage value. 
Is This Answer Correct ?    7 Yes 0 No
Dipendra
 
Answer
# 2
scanf() returs the number of vlaues read successfully. so
heree the pritf() prints the value that is returned by the
scanf(), ie 2.(a,b). so the output will be 2 and some
garbage value.
 
Is This Answer Correct ?    4 Yes 0 No
Amegha
 
 
 
Answer
# 3
what is output of this program
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
a=10;
b=20;
printf("%d %d");
getch();
}

it gives the 20 10;
bcoz printf fn return which value,
read recently ,reversely.
so above question we easly explain.
that;-
so scanf fn return which value process it.
scanf fn return 2 and after return value of b.


manish soni bca 3rd year jaipur tagore college
 
Is This Answer Correct ?    1 Yes 0 No
Manish Soni Bca 3rd Year Jaipu
 
Answer
# 4
if we enter
1234
5678
answer is
2 5678
plz tell how
 
Is This Answer Correct ?    1 Yes 1 No
Manish Soni Bca 3rd Year Jaipu
 
Answer
# 5
you are right mr. manish that it will print 2 and value of
'b' but i also dont know why it is printing the value of 'b'..
 
Is This Answer Correct ?    0 Yes 0 No
Akki166786
 
Answer
# 6
the output will be what value of a and b... 
Is This Answer Correct ?    1 Yes 8 No
Nilambuja
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
how to sort two array of characters and make a new array of characters. Accenture 1
hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p: &p=6 ?????????   1
The variables are int sum=10,SuM=20; these are same or different?   3
What is the difference between macros and inline functions? L&T 3
Given a string write a program to print all alphabetical characters in the order of their occurance first,followed by the sum of the numeric characters then followed by the special characters in the order of their occurance. wipro 1
wat are the two methods for swapping two numbers without using temp variable??   2
write function to reverse char array ... without using second array   2
Difference between for loop and while loop?   1
Is both getch() and getchar() functions are similar? if it is similar means why these two functions are used for same usage? if it is not similar means what is the difference? Infosys 1
suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan   1
What is sparse file?   1
why i join syntel? Syntel 22
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com