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


Please Help Members By Posting Answers For Below Questions

What is SAP TAO? · Which Version you are using? · What is the Latest Version in SAP TAO? · What are the Advantages in SAP TAO? · What are the Patches required for SAP TAO? · What is BPT? · Difference between BPT & SAP TAO? · Which Framework using for SAP TAO? · What is CBASE? · What is the SAP TAO Architecture? · What are the Prerequisites for SAP TAO? · SAP Solution Manager Mandatory for SAP TAO 1.0? · SAP Solution Manager Mandatory for SAP TAO 2.X? · What is UI Scanner? · What is Inspector? · How many ways to Create a components using TAO 1.0? · How many ways to Create a components using TAO 2.x? · Which service pack required for SAP TAO 2.7? · What is Import/Export? · What is Consolidate?

2391


what are the things i had to say in personal introduction in hr round mail me to prasanna.1867@rediff.com

1682


Is there any standard procedure to test the application as a whole? Or How can I test complete application right from the requirement gathering?

1474


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

1429


Can i please VHDL code for D-Latch with clear input ?? (HINT: Set up a “Process” with appropriate sensitivity list to get the desired D-Latch with Clr working.) Inputs and Outputs: entity Lab4b is Port ( Clr, Clk, D : in STD_LOGIC; Q : out STD_LOGIC); end Lab4b;

992






they asked me about srs (software requirement specifcation)? how can i get anydocumentation about srs & other documnts infomation like bdd, in testing? its urgent?

1454


i am getting the error while compiling my cics program with including db2 dclgen member it is showing that ur dclgen member not including and all the host variables are undeclared

1093


Display names and numbers of employees who have 5 years or more experience and  salary less than Rs.15000 using array of structures (name, number, experience and  salary)

4301


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

1549


I HAVE DONE TESTING TOOLS COURSE,NOW I AM FRESHER,I AM NOT GETTING ANY CALLS,I WANT TO DO THE PROJECT ,WHERE I HAVE TO MEET TO DO THE PROJECT,I AM GOING WITH FAKE EXPERIENCE,SO WHAT I HAVE TO DO.

4302


how to fin top two miximum values in sql? not 2nd both max value of 1st and 2nd both have to find out

1491


what is the BAM? where we can use it in BizTalk server?

1356


when will triggars the at new event in abap and web dybn pro?

1492


WHAT IS MAIN IMPORTANT THING IN SOFTWARE?

1723


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

792