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

What are conditional operators in C?

1042


What is the newline escape sequence?

1019


How is actual parameter different from the formal parameter?

972


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

982


What is ambagious result in C? explain with an example.

2550


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1029


What is this infamous null pointer, anyway?

987


What is malloc and calloc?

1001


What are the types of data files?

1143


What is the maximum no. of arguments that can be given in a command line in C.?

1081


If fflush wont work, what can I use to flush input?

1043


What is getch () for?

1140


What is union in c?

1054


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

23582


What is difference between Structure and Unions?

1182