Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between GETS();AND SCANF();

Answer Posted / vignesh1988i

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 ?    103 Yes 47 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c so important?

997


Explain the bubble sort algorithm.

1005


How can you read a directory in a C program?

1095


number of times a digit is present in a number

1988


What is a char in c?

931


What is nested structure with example?

1012


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1012


what will be the output for the following main() { printf("hi" "hello"); }

10799


What is a pointer and how it is initialized?

1082


How does selection sort work in c?

984


What does nil mean in c?

1182


What is the significance of c program algorithms?

1098


What is the process to generate random numbers in c programming language?

1098


How is a pointer variable declared?

1023


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3915