Originally posted by jay_rocks:
still the same problem. no idea what to do for the
whileloop, how to make it stop and starts and oso count.
some things i've added, then stuck.
#include
void main(void)
{ float hrs, min, sec,count;
char q,[b]choice;
printf("1.Press 1 to start\n");
scanf("%c",&choice);
hrs = 0;
min = 0;
sec = 0;
count = 0;
while ( )
{ count = count + 1;
if(hrs>23)
{ hr = 0;
}
else
{hrs = hrs +1;}
if(min>59)
{ min = 0;
}
else
{min = min +1;}
if(sec>59)
{ sec = 0;
}
else
{sec = sec + 1;}
printf("%d hr: %d min: %d sec",hrs,
min,sec);
}
[/b]
of coz, cant work... because
1) 1 cycle of loop is not equal to one sec...
2) u r incrementing hr+1 , min+1 , sec +1 every cycle
3) u will not be able to see the change
n blah blah blah