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
Difference between views and index in sas programming
Hello Experts, What is the difference between move and move corresponding exactly? please post me asap
how to check single or double byte in struts
How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?
I am work in it aompenei
In mainframe SDSF, Can we copy the list of jobs currently executing in SDSF in to a seperate DATASET...?
how to remove header and footer in jcl using sort utility
Diffrence between 2.0,3.0,3.5,4.0. versions of .net?
can any method return type may be constructor , or that method name allow
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
Plz sent me in .net 2.0 interview Question & answers?
How to call a C++ function which is compiled with C++ compiler in C code?
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.
What is the difference between DECISION COVERAGE(DC) and MODIFIED CONDITION/DECISION COVERAGE(MCDC)?
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)