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
In C programming, what command or code can be used to determine if a number of odd or even?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is structure in c explain with example?
What are pointers really good for, anyway?
Define Spanning-Tree Protocol (STP)
Explain high-order and low-order bytes.
Are there constructors in c?
Add Two Numbers Without Using the Addition Operator
Explain what math functions are available for integers? For floating point?
write a program to concatenation the string using switch case?
What is the use of a ‘ ’ character?
What are pointers? What are stacks and queues?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
what is the syallabus of computer science students in group- 1?
Can a variable be both static and volatile in c?