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

Answer Posted / batchu

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int hour,minute;
float angle;
printf("Enter the hour: ");
scanf("%d", &hour);
printf("Enter the minute: ");
scanf("%d", &minute);
if(hour>12)
{
hour = hour-12;
}
angle = hour * 30 + minute*0.5 - minute * 6;
if(angle>180)
{
angle = 360 - angle;
}
if (angle < 0 )
{
angle = angle * (-1);
}
printf("%f \n", angle);
return 0;
}

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1582


what is the current salary package in India for a lamp programmer

1876


9.Difference between even and odd signals?explain with the diagram?

2964


what are resources in case of Threads

1665


Hi guyes, I have cleared 2 technical rounds with cts for liferay and java techonologies, i have client round next week, please tell me how to prepare for this what questions i should be ready to face?

3364






Delta 5 weight scale not connect with oracle application what i can do?

1810


i am exeprienced person what is selection process

1131


Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can?t pass the value k to any function also.

556


what is the use of occurs 10 or (any number) in the internal table declaration with header line.

1470


hoe to data grid use in sql server 2000?

1601


Write a shell program to test whether a given year is leap year or not ?

2263


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

792


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

1848


What is test execution and when will we start execution please send me one example for this question

1429


How to connect to ms word wit VB ojective is to prepare s/w to generate question paper , selects questions randomly from the ms access , database

2014