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 the advantages of sap on other software ?
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
Hello...has anyone interviewed with Information Management Services(IMS)located in Silver Spring MD??If yes,what can you share about the programming test and the analytical test?
4. What is the need of START 0? Instead if can we use any other numeric? If we use what will happen?
How does the TCP handle the issue of multiplexing?
what is class module in vb6? what it's use? with example..
1. Consider the following code in our example assembly language: ; an example bit of assembly code ROOT: W FATHER FATHER: W SON1 W SON2 SON1: W NIL W NIL ; ---------------------- SON2: W GRANDSON W NIL GRANDSON: W NIL W NIL NIL = 0 Assemble this code carefully following the two pass model, and show the symbol table at the point marked by the dashed line during each pass.
Compare any 4 software development life cycle paradigms with each other. Indicate at least one application for each of the paradigms that are suitable to developed using that paradigm.
can we allocate memory for interface? if no then why?
hi viewers, tell me,what is scripting and programming, define and difference...pls
What binary value will be internally stored for NULL for the type S9(1) COMP 3 in 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?
Diff between IF and where ?
iam confused among testing ,.net and java. can anybody help me.
Have you used callsymputx? what points need to be kept in mind when using it?