We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Once you are done giving your input of array values, press ctrl+D to signal the end of stdin input. You have to press ctrl+D when you are manually entering data using cat in terminal because cat doesn't know when to stop reading input from stdin. In here, the input to your program is provided through a file, so cat stops reading further input once it reaches the end of file. That's how it knows when to stop!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Compute the Average
You are viewing a single comment's thread. Return to all comments →
Once you are done giving your input of array values, press ctrl+D to signal the end of stdin input. You have to press ctrl+D when you are manually entering data using cat in terminal because cat doesn't know when to stop reading input from stdin. In here, the input to your program is provided through a file, so cat stops reading further input once it reaches the end of file. That's how it knows when to stop!