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
What is the difference between DECISION COVERAGE(DC) and MODIFIED CONDITION/DECISION COVERAGE(MCDC)?
what is the difference between rename and label
where is available in this mantis toturials?
without selecting individually each field in Action Class from jsp,what is the best process to select as many as field at a time automatically from jsp page by using value object class.
My Qualification is MCA.My interview is on 5th may.They may ask q as------AS u r MCA...Why u r not tring anywhere else? What can be the ans?
what is difference between object oriented programming structure and object oriented programming system?
how to stop execution of step 3 in a job mainframe
when a query is made on Logical file in DB2/400, will the records satisfying select/omit criterion be fetched from all members of physical file or only the member with same name as physical file?
Write a pascal program to calculate the sum of the first 100 even number and odd number
< DL Compact > tag is used for
Is buffer size and file block size is similar? If similar,at which case it will be same size?
How to call a C++ function which is compiled with C++ compiler in C code?
what is log files in qtp what is use
how do i add a column dynamically in a table by using java application?
hai i am mca 2009 fresher.please tell me which certification helps me to get an IT job faster which institute is good in hyderabad.please mail me to prasanna.1856@rediff.com