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
WHAT IS THE DIFFERANCE BITWIN GETS();AND SCANF();
 Question Submitted By :: Akashjg
I also faced this Question!!     Rank Answer Posted By  
 
  Re: WHAT IS THE DIFFERANCE BITWIN GETS();AND SCANF();
Answer
# 1
gets() read the string values which allows white spaces 
also. whereas, scanf() doesn't allow.
 
Is This Answer Correct ?    5 Yes 0 No
Bharath
 
  Re: WHAT IS THE DIFFERANCE BITWIN GETS();AND SCANF();
Answer
# 2
the main difference between gets() and scanf() function is that while getting any input as a stream of characters or as a string using scanf() , the end termination character is a blank space or an enter key for scanf() , so upto blank space it will be saving it in the memory...... SHORTLY it ignores the characters comin after and with blank spaces........


in gets() , it allows with the blank spaces and the termination condition is a enter key (\n) , 


but a inside gets() function , surely they would have used scanf() function , but the difference is that the input inside gets() would go character by character , so only gets() can allow with the blank spaces...........


thank u
 
Is This Answer Correct ?    2 Yes 0 No
Vignesh1988i
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
how can i make a program with this kind of output.. Enter a number: 5 0 01 012 0123 01234 012345 01234 0123 012 01 0 Wipro4
what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); } Infosys15
what is the function of void main()?  6
what is the return value (status code) of exit() function.... what the arguments(integer value) passed to it means.... TCS1
how to copy a string without using c function  5
how to find out the reverse number of a digit if it is input through the keyboard?  2
Why doesn't the code "a[i] = i++;" work?  4
Write code for atoi(x) where x is hexadecimal string. Adobe2
what is a far pointer TCS9
5. What kind of sorting is this: SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort Accenture2
how to return 1000 variables from functio9n in c?plz give me code also  5
Is it possible to run a c program without using main?If yes HOW?? Wipro10
convert 0.9375 to binary CTS1
a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=? Geometric-Software6
write a string copy function routine?  1
what is difference between ++(*p) and (*p)++ Accenture15
write a own function to compare two strings with out using stringcomparition function? LG-Soft3
how to find the size of the data type like int,float without using the sizeof operator?  7
Will Macros support multiple arguments ? Oracle7
what are the general concepts of c and c++  1
 
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