#include <iostream>
#include <string>
using namespace std;
/*
add std:: infront of cout, and between endl; example std::endl; disable namespce above with forward // to comment it out, for your output to work, otherwise just add using namespace std; to run your code.
*/
int main()
{
int x;
int y;
cout<<"Unesite broj koja oznacava sate: "<<endl;
//or they are both the same, just differnt flavour
printf("Unesite broj koja oznacava sate: /n");
do {
cin>>x;
if (x<0 || x>23)
cout<<"Unijeli ste krivi broj! Pokusajte ponovo..."<<endl;
}
while (x<0 || x>23);
cout<<"Unesite broj koji oznacava minute: "<<endl;
do {
cin>>y;
if (y<0 || y>59)
cout<<"Unijeli ste krivi broj! Pokusajte ponovo..."<<endl;
}
while (y<0 || y>59);
cout<<"Trenutno je :"<<x<<":"<<y<<endl;
/*
While is not recommended in your code, while is infinity, and your code is running and is dangerous to use, it can really ruin your code, you should use a if else, then while to catch the error. Exception catching can be handy when a while is thrown it can be caught running in the back ground as a fail safe, or as a listener where the do was inputted, yet the if was fired under a certain condition resulting in a while condition to pick it as either true or false, where you have two while loops running. Stick with if() if else conditions first then switchs, you'll learn that while loops are like on and off switches later.
*/
return 0;
}