#include <iostream>
using namespace std;
int main()
{
int hour, minut, second, angle1, angle2, angle;
cout << "Enter hour: ";
cin >> hour;
cout << "Enter minut: ";
cin >> minut;
cout << "Enter second: ";
cin >> second;
//angle between hour and minut.
if(angle1 == 12)
angle1 = 0;
angle1 = hour*30;
angle2 = minut*6;
angle = angle2 - angle1;
if(angle < 0)
{
angle1 = 360 - angle1;
angle = angle1 + angle2;
}
cout << "Angle between hour and minut is: ";
cout << angle << endl;
//angle between hour and second.
if(angle1 == 12)
angle1 = 0;
angle1 = hour*30;
angle2 = second*6;
angle = angle2 - angle1;
if(angle < 0)
{
angle1 = 360 - angle1;
angle = angle1 + angle2;
}
cout << "Angle between hour and second is: ";
cout << angle << endl;
//angle between hour and second.
angle1 = minut*6;
angle2 = second*6;
angle = angle2 - angle1;
if(angle < 0)
{
angle1 = 360 - angle1;
angle = angle1 + angle2;
}
cout << "Angle between hour and second is: ";
cout << angle << endl;
cout <<endl;
system("pause");
}
using namespace std;
int main()
{
int hour, minut, second, angle1, angle2, angle;
cout << "Enter hour: ";
cin >> hour;
cout << "Enter minut: ";
cin >> minut;
cout << "Enter second: ";
cin >> second;
//angle between hour and minut.
if(angle1 == 12)
angle1 = 0;
angle1 = hour*30;
angle2 = minut*6;
angle = angle2 - angle1;
if(angle < 0)
{
angle1 = 360 - angle1;
angle = angle1 + angle2;
}
cout << "Angle between hour and minut is: ";
cout << angle << endl;
//angle between hour and second.
if(angle1 == 12)
angle1 = 0;
angle1 = hour*30;
angle2 = second*6;
angle = angle2 - angle1;
if(angle < 0)
{
angle1 = 360 - angle1;
angle = angle1 + angle2;
}
cout << "Angle between hour and second is: ";
cout << angle << endl;
//angle between hour and second.
angle1 = minut*6;
angle2 = second*6;
angle = angle2 - angle1;
if(angle < 0)
{
angle1 = 360 - angle1;
angle = angle1 + angle2;
}
cout << "Angle between hour and second is: ";
cout << angle << endl;
cout <<endl;
system("pause");
}