Conversion a Minutos Y Segundos

Lee Un Numero y Los convierte a minutos y segundos ej. 130 = 2 minuto y 10 segundos

# include <iostream>
using namespace std;

int main()
{

int N; /*Numero en Segundos*/
int C; /*Cociente o Minutos*/
int R; /*Residuo o Segundos*/

cout<<endl<<"\t\tIngrese un Numero (Segundos): ";
cin>>N;

if (N<60)
{
cout<<endl<<endl<<"\t\t ";
cout<<"Equivale a: "<<0<<" Minutos "<<"y "<<N<<" Segundos";
}

else
{
R=N%60;
C=(N-R)/60;
cout<<endl<<endl<<"\t\t ";
cout<<"Equivale a: "<<C<<" Minutos "<<"y "<<R<<" Segundos";
}

cout<<endl<<endl;

system("pause");

}
Siguiente
« Post Anterior