0
I wrote a code for timer but I am getting output as" no output".
#include <iostream> using namespace std; int main() { int secondspassed=0; int minspassed=0; int hourspassed=0; while(hourspassed<=24) secondspassed++; cout<<"Hrs=0, Mins = 0"<<"Secs"<<secondspassed<<endl; if(secondspassed==60 ) { minspassed ++; secondspassed=0; secondspassed ++; cout<<"Hrs = 0, "<<"Mins= "<<minspassed<<", Secs = "<<secondspassed<<endl; } if(minspassed==60 ) { hourspassed++; minspassed=0; secondspassed=0; secondspassed ++; cout<<"Hrs = "<<hourspassed<<",Mins= "<<minspassed<<", Secs = "<<secondspassed<<endl; } return 0; }
4 odpowiedzi