Write program to calculate odd clock (h.m.s)from (1:00:00)to (12:59:59) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write program to calculate odd clock (h.m.s)from (1:00:00)to (12:59:59)

how can do this question???by using loop

12th Sep 2017, 7:42 AM
Bts...
Bts... - avatar
7 Answers
+ 2
I tried to Google search for odd clock also no help...
12th Sep 2017, 10:13 AM
Calviղ
Calviղ - avatar
+ 1
What "odd clock" actually is?
12th Sep 2017, 9:19 AM
Calviղ
Calviղ - avatar
+ 1
alright , let's see if these what you need for : for ( int hour = 0 ; hour <= 12 ; hour++ ) { for ( int minute = 0 ; minute < 60 ; minute++ ) { for ( int second = 0 ; second < 60 ; second++ ) { Console.WriteLine( "Hour : " , hour , " Minute : " , minute , " Second : " , second); //do what you want in here , let's say ODD thing you need. if ( hour % 2 == 1 ) { } //Your ODD Hour if ( minute % 2 == 1 ) { } //Your ODD Minute if ( second % 2 == 1 ) { } //Your ODD Second } } } Bump these ODDness LoL.
12th Sep 2017, 8:03 PM
Mikhael Anthony
Mikhael Anthony - avatar
+ 1
# include <iostream> using namespace std; int main() { for(int h=1;h<=12;h++) for(int m=1;m<=59;m++) for(int s=1;s<=59;s+=2) cout<<h<<":"<<m<<":"<<s<<endl; return 0; }
12th Sep 2017, 8:12 PM
Bts...
Bts... - avatar
0
just calculate odd clock from 1 to 12
12th Sep 2017, 9:23 AM
Bts...
Bts... - avatar
0
I am solution this problem
12th Sep 2017, 4:30 PM
Bts...
Bts... - avatar
0
but you should do cout
12th Sep 2017, 8:10 PM
Bts...
Bts... - avatar