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
Why is c so important?
Explain the bubble sort algorithm.
How can you read a directory in a C program?
number of times a digit is present in a number
What is a char in c?
What is nested structure with example?
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
what will be the output for the following main() { printf("hi" "hello"); }
What is a pointer and how it is initialized?
How does selection sort work in c?
What does nil mean in c?
What is the significance of c program algorithms?
What is the process to generate random numbers in c programming language?
How is a pointer variable declared?
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.