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

Difference between views and index in sas programming

1028


Hello Experts, What is the difference between move and move corresponding exactly? please post me asap

1342


how to check single or double byte in struts

1567


How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?

1510


I am work in it aompenei

976






In mainframe SDSF, Can we copy the list of jobs currently executing in SDSF in to a seperate DATASET...?

1853


how to remove header and footer in jcl using sort utility

5107


Diffrence between 2.0,3.0,3.5,4.0. versions of .net?

2769


can any method return type may be constructor , or that method name allow

1588


Write a shell program where you enter a number which corresponds to K.M. Find out the corresponding values in m, cm, inches, and feet. Hints:- 1 k.m= 1000 m 1 m= 100 cm 1 inches= 2.54 cm. 1 feet= 12 inches

1525


Plz sent me in .net 2.0 interview Question & answers?

1647


How to call a C++ function which is compiled with C++ compiler in C code?

796


Given: coordinates of rectangle-> left bottom and right top points. the rectangles create a hole.Find the maximum area of the hole. eg. 4 rectangles create a hole in between. find its area.

1983


What is the difference between DECISION COVERAGE(DC) and MODIFIED CONDITION/DECISION COVERAGE(MCDC)?

1785


Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

765