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 are other resources are needed for this mantis?
what are the topics choosen for jam round for interviews
how can i split string in a textbox in windows appication using C#.net
what is client server & server? What r types of Joins? explsin it! which types of indexex in sql server? what is triggers?
how to generate dsnless connectivity in j2ee
can we use commit,rollback in triggers and how?
what is the difference between SCAN AND CHECK,LOKUP AND XFOOT? where we can use thease opcodes? Can any body tell me real time senariao with example?
what is difference between kpo and it industry? that is in terms of work, package etc
How to set on/off a group of indicators in a single statement?
qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again
how do i add a column dynamically in a table by using java application?
Code for display the images from drive using vb 6.0?
I m new to the dbms. Recently i came across words clustered indexes & nonclustered indexes but i dont know what is this all about & whats the difference between them.. So please help me!!!!!!!!
how do i create my own exception class which will restrict IO exception?
how pseudo column works?