Hi,
Please help me out in solving this Q.I am newbie and I am not sure whether I am doing right thing??
The Q is to take swim,cycle,run times from user and display the best from each leg of competition.
thanks in advance.
I am submiiting code for calculating the best swim time:
My test data:Code:int main() { int best_swim_time=1000; do{ if(swim_time<best_swim_time)//swim_time entered by user// { be_swim_time= swim_time; best_swim_name= nam; } }while(true);
1st competitor:- ST:18sec,RT:3sec,CT:4sec
2nd competitor:- ST:10sec,RT:8sec.CT:13sec
results:best ST 2nd competitor (which is right)
best CT,RT again 2nd competitor(which is wrong)
1st competitor:- ST:2sec,RT:4sec,CT:9sec
2nd competitor:- ST:9sec, RT:3sec,CT :2sec
results:best RT & CT 2nd competitor(which is right)
best ST again 2nd competitor(which is wrong)



LinkBack URL
About LinkBacks


