Hi to all,can anyone tell me please why is the code doesn't behave as it should. It dispalys hours and minutes from 19:00-23:59 ,but not from 00:00-23:59? Here is the code.
#include "stdafx.h"

using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{

int hours ,minutes ;



    for(hours =0; hours<24; hours++)
    {

        for( minutes=0;minutes<60;minutes++)
        {
            cout<<setw(2)<<setfill('0')<<hours<<setw(2)<<setfill('0')<<minutes<<endl;
        }
    }


    return 0;
}

Are you sure the previous output isn't scrolling out of the console buffer? Put a pause every hour and you'll probably see all of the output.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.