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
Why did you ever become involved in QA/testing?
I want to insert date in the form of yyyy-mm-dd... if any changes happen while inserting date format want to show error meg...any one can solve this..??
Plz sent me in .net 2.0 interview Question & answers?
What is the difference between COM and CORBA?
I m Abdullah Ansari compleated MCA from Jamia Hamdard,i have appeared the test of IBM on 2 august at oxford college of engineering Bangalore.waiting for hr round.. This is the first round for IBM.02/08/08 Paper consists of 4 sections 15 questions from matrices(time very less but no negative marking). 25 questions from series completion section (this section is very easy but negative marking) 15 questions from aptitude(little bit tough time limit 15 minute negative marking) 4th section is from computer science (c,c++,operating system,digital electronics ,basic question..) result came at 3 o'clock.i was selected... In interview they asked questions like 1 they asked about final yr project.. 2 what are dynamic and static memory location? 3 linked list and array difference between them. 4 what is function ? what is difference betwen function and inline function? 5 about structure 6 about binary tree, traversal, call by value. 7 storage class and many more basic questions..
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fit" instead of the number and for the multiples of five print "Bit". For numbers which are multiples of both three and five print "FitBit".
what is the current salary package in India for a lamp programmer
hii I inntrested abt scjp certification but i dont knw abt scjp plz send details abt scjp exam and syllabus.
Write a program to show polymorphism.
when we use mantis? how learn mantis?
hi i m deepak my shedule for NIC pi is 17 Apr please contact me if anybody has interview on same day or give me some idea who have faced
Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
What for decision coverage and modified condition decision coverage are used? Wat is the difference between them?
Can anyone send me NIC question papers alongwith answers on nidhi1485@yahoo.co.in? Urgently needed.. Thanks in advance
how to remove header and footer in jcl using sort utility