Write a Pseudo Code to find the angle between two hands of a
clock for a given time.

Answer Posted / samer el-haj-mahmoud

#include<stdio.h>
int main()
{

int angle,hour,minute;
printf("Enter the hour: ");
scanf("%d", &hour);
printf("Enter the minute: ");
scanf("%d", &minute);

if(hour > 12) // In case of 24 hour clock
{
(int)angle = hour * 30 + minute / 2 - minute * 6;

if(angle > 180)
angle = 360 - angle;
printf("%d\n", angle);
}
else
printf("bye\n");

return 0;
}

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the purpose of checked Menu options

2187


Tag for turning an image into a hyperlink is

2059


how can we maintain the previous version scripts to new version.

1646


how pseudo column works?

1915


What ports must be open for DCOM over a firewall? What is the purpose of Port 135?

7502


How to change the color of a cell or a row in a datagrid on mouse hover using javascript/.net

1725


how to remove header and footer in jcl using sort utility

5310


What are the Short cut Keys of Tally ERP?

2010


Explain three modes in which files can be accessed from python program

1512


what is meaning of MDM in sap?let me know that meaning

1918


What is the difference between CLEAR & RESET and OPEN & CLOSE OPCOEDS(USING RPG/400).wheare we can use this?can any body tell me in real time senario with example please?

1786


what is the work of 1tier,2tier,&ntier? Plz Explain it!

2205


what is the difference between Windows application and Unix application?

2353


what do u mean by tagging

1800


the systematic access of small computers in a distributed data processing system is referred as?

2949