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

Explain that why C is procedural?

646


What are c preprocessors?

662


Explain how do you convert strings to numbers in c?

582


Is c procedural or functional?

577


How can I send mail from within a c program?

569






Is Exception handling possible in c language?

1569


What is difference between structure and union?

586


Differentiate between static and dynamic modeling.

605


provide an example of the Group by clause, when would you use this clause

1692


How old is c programming language?

563


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

1714


Why is main function so important?

605


Is c++ based on c?

640


Why is this loop always executing once?

607


What is the difference between char array and char pointer?

519