//thisfilewillcalculatethehourminutesecondtellreaderhowmuchsecondsbetweenthem.
#includeiostream
#includestring
#includecmath
usingnamespacestd;
intmain();
{
doubletimetotime(doubleh1,m1,s1,h2,m2,s2);
doubleh1,m1,s1,h2,m2,s2,T;
cout\"Programsecondscalculatesthenumberofsecondsbetweentwotimes:\"endl;
cout\"Pleaseenteratime(hoursminutesseconds):\"endl;
cinh1m1s1;
cout\"Pleaseenteratime(hoursminutesseconds):\"endl;
cinh2m2s2;
if(0h124,0h224,0m160,0m2m2,0s160,0s2s2)
{
if(h1=h2)
{
T=h2*60*60m2*60s2-(h1*60*60m1*60s1);
if(T=1)
{
cout\"Between\"h1\":\"m1\":\"s1\"and\"h2\":\"m2\":\"s2\"thereis\"T\"second.\"endl;
}
else
{
cout\"Between\"h1\":\"m1\":\"s1\"and\"h2\":\"m2\":\"s2\"thereis\"T\"seconds.\"endl;
}
}
else
{
T=h1*60*60m1*60s1-(h2*60*60m2*60s2);
if(T=1)
{
cout\"Between\"h1\":\"m1\":\"s1\"and\"h2\":\"m2\":\"s2\"thereis\"T\"second.\"endl;
}
else
{
cout\"Between\"h1\":\"m1\":\"s1\"and\"h2\":\"m2\":\"s2\"thereis\"T\"seconds.\"endl;
}
}
}
elseif(h1=24||h10||h1=24||h10)
{
cout\"Hoursmustbetween0to23!\"endl;
}
elseif(m1=60||m10||m1=60||m10)
{
cout\"Minutesmustbetween0to60!\"endl;
}
elseif(s1=60||s10||s1=60||s10)
{
cout\"Secondsmustbetween0to60!\"endl;
}
else
{
cout\"Can\'tfindthetime!\"endl;
}
return0;
}
C:\\C\\HOMEWORK.CPP(420):errorC2447:missingfunctionheader(old-styleformallist?)
|