ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> Programming Languages AllOther
 
 


 

 
 C interview questions  C Interview Questions (2248)
 C++ interview questions  C++ Interview Questions (1106)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  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.
Answer
# 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.
Answer
# 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.
Answer
# 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.
Answer
# 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.
Answer
# 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.
Answer
# 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
 

 
 
 
Other Programming Languages AllOther Interview Questions
 
  Question Asked @ Answers
 
4.Write a program to get the string in array and print that? or Without using loop print the array.   2
what are the top level class of interface in java? Satyam 1
What is meant by spooling Qiscet 2
converting 41.685 to binary Hughes 1
Which tag is used to break a line   3
What is a dialog based program   1
hi, i'd like to know how do you set lines in a page for Smartforms? thanks in advance SAP-Labs 1
if heap sort contains n elements, no of comparsions required are Hughes 2
what is microprocessor? HCL 1
What are scrubbing procedures in SAS IBM 1
Caret means to you   1
what is difference between oracle and pl/sql   1
 
For more Programming Languages AllOther Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com