Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
 Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE

 Categories >> Software >> Programming Languages >> Programming Languages AllOther

 C Interview Questions (2247) C++ Interview Questions (1104) VC++ Interview Questions (342) Delphi Interview Questions (510) Programming Languages AllOther Interview Questions (644)
Question
```Write a Pseudo Code to find the angle between two hands of a
clock for a given time.```
Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By

Re: Write a Pseudo Code to find the angle between two hands of a clock for a given time.
# 1
#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 * 6;

if(angle > 180)
angle = 360 - angle;
printf("%d\n", angle);
}
else
printf("bye\n");

return 0;
}

 Is This Answer Correct ? 2 Yes 16 No
Mamun

Re: Write a Pseudo Code to find the angle between two hands of a clock for a given time.
# 2
#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
hour=hour+12;//to make the hour in 24 hour format;
{
(int)angle = hour * 30 - minute * 6;

if(angle > 180)
angle = 360 - angle;
printf("The angle between the two handle is: ");
printf("%d\n", angle);
}

return 0;
}

 Is This Answer Correct ? 12 Yes 11 No
Spacious Mamun

Re: Write a Pseudo Code to find the angle between two hands of a clock for a given time.
# 3
#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
Samer El-haj-mahmoud

Re: Write a Pseudo Code to find the angle between two hands of a clock for a given time.
# 4
#include<stdio.h>

main()
{

int hr,min;
double angle;
printf("Enter hour and minute in 24 hr format\n");
scanf("%d %d",&hr,&min);
angle=30*hr+(double)min/2-min*6;
if(angle<0) angle*=-1;
while(angle>180) angle-=180;

printf("%.2f\n",angle);
return 0;
}

 Is This Answer Correct ? 3 Yes 6 No
Fanatic

Re: Write a Pseudo Code to find the angle between two hands of a clock for a given time.
# 5
le angle;
printf("Enter hour and minute in 24 hr format\n");
scanf("%d %d",&hr,&min);
angle=30*hr+(double)min/2-min*6;
if(angle<0) angle*=-1;
while(angle>180) angle-=180;

printf("%.2

 Is This Answer Correct ? 2 Yes 2 No
Thsghdth

Re: Write a Pseudo Code to find the angle between two hands of a clock for a given time.
# 6
#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 ? 5 Yes 1 No
Batchu

  Question Asked @ Answers Other Programming Languages AllOther Interview Questions Who is providing best mainframes online training in Hyderabad 1 What is the meaning of .(dot) in .NET framework? HCL 1 Corillian's product is a "Component Container." Name at least 3 component 1 How same session variable can be used in both Asp and Asp.net? Wipro 1 Why data bus is bidirectional and address bus is unidirectional? Wipro 3 what is delegats ? 4 Artficial language is provided which of the language? Geometric-Software 3 what is fisrt female program 1 How to link calculator in oops concept? how is it working in oops concept? why dont u using in beginning of program 'z' in abap(sap)? 2 How to find the aerry size Cap-Gemini 1 What is Partial class and its use? 1 what is dynamic polymorphism? Satyam 2 For more Programming Languages AllOther Interview Questions Click Here