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

Answer Posted / niraj kumar

Main difference between '%s' and 'gets' is:
%s ends taking input when it encounter whitespace, new line(
) or EOF.
gets takes whitespace and stops taking input when it encounters new line(
) or EOF.

Is This Answer Correct ?    14 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you call a function, given its name as a string?

716


Explain what is wrong with this statement? Myname = ?robin?;

1043


What is calloc malloc realloc in c?

598


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

660


What is masking?

641






In a header file whether functions are declared or defined?

632


Where register variables are stored in c?

555


What is a nested loop?

653


Can we change the value of #define in c?

588


Once I have used freopen, how can I get the original stdout (or stdin) back?

631


What is the use of parallelize in spark?

580


Are pointers really faster than arrays?

569


What are the advantages of using macro in c language?

596


Explain is it valid to address one element beyond the end of an array?

739


Write a program that accept anumber in words

1256