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

what are other resources are needed for this mantis?

1696


what are the topics choosen for jam round for interviews

1406


how can i split string in a textbox in windows appication using C#.net

2415


what is client server & server? What r types of Joins? explsin it! which types of indexex in sql server? what is triggers?

1721


how to generate dsnless connectivity in j2ee

1713






can we use commit,rollback in triggers and how?

1698


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?

2317


what is difference between kpo and it industry? that is in terms of work, package etc

1723


How to set on/off a group of indicators in a single statement?

1569


qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again

2546


how do i add a column dynamically in a table by using java application?

1719


Code for display the images from drive using vb 6.0?

4629


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!!!!!!!!

1731


how do i create my own exception class which will restrict IO exception?

2495


how pseudo column works?

1904