Time taken by Input/Output Functions.

Which input/output format takes more time .
cin and cout
or
printf and scanf.

Why?? give me a proper explanation.

4 Likes

Hello @upendra1234,

As a general consensus around here, it is clear that cin/cout are way slower than scanf/printf…

Before searching for it, I thought it was because cin/cout are more high-level functions that scanf/printf, as they are convenientely wrapped around an interface which makes them easier to use than scanf/printf…

However, it seems that it is a bit implementation dependent, and you can read a discussion on this subject, here. The last post contains a link to another discussion on this matter!!

Best regards,

Bruno

2 Likes

@kuruma thanks
i got the main thing.

4 Likes