Changed printf() to cout