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

I need source code for Enrollment System using Visual Basic 6.0/2008 database MS Access 2007 for my school thesis project...please help me..kindly send in my email jpinedamcp@gmail.com

1578


THERE ARE 4 SOURCE FILES WHICH CONTAINS SAME METADATA CREATE A TARGET THAT SHOULD DISPLAY THE FILE NAME ALONG WITH THE RECORD PLEASE SEND THE ANSWERFOR THIS QUESTION WITH MAPPING

1670


how can i create report in abap to insert data in table pa0002 using insert command

1700


what is adodb??y it is used for connection of V.B and access??what is ado?dao?

1766


Have you used callsymputx? what points need to be kept in mind when using it?

1534






Explain what is OOPS and its concepts?

567


it is a language or tools?

1617


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

1677


what is web service in java? have u use before.

1623


what is throws keyword

2975


hi..this is kartheek..complted mca in 2009..but i dont have knowledge in programing..but to learn new language.. which one is suitable for me?is SAP or IBM mainframes is suitable for me..?if it suits how much will it costs..?pls answer...

1540


what is the last ant version you worked?how to get it

1455


hi i m deepak my shedule for NIC pi is 17 Apr please contact me if anybody has interview on same day or give me some idea who have faced

1551


Difference between views and index in sas programming

1018


What is the use of Differ interface check box in Ship confirm?

1839