Question: what is difference between scanf and cin?
Answer: Why is scanf faster than cin? On a high level both of them are wrappers over theread() system call, just syntactic sugar. The only visible difference is that scanf() has to explicitly declare the input type, whereas cin has the redirection operation overloaded using templates.