i need help :)))

Discussion in 'C' started by PLM, Sep 28, 2011.

  1. PLM

    PLM New Member

    Sep 26, 2011
    Likes Received:
    Trophy Points:
    guyss could you help me solve the following ?? THANKS in advance :">

    * two positive integers i and j are considered to be relatively prime if there exist no integer greater than 1 that divides them both. Write a function rel_prime that has two input parameters, I and j, and returns a value of 1 if and only if I and j are relatively prime. Otherwise, rel_prime should return a value of 0.

    Case Study Military Time
    * in military, when one gives a time it is usually in a 24-hour notation (e.g. 1300 means 1:00pm). Write a program that converts from 24-hour notation to 12-hour notation using function :)

    input specification -- the input must be a single integer ranging from 0 to 2400. Any other value must result into an input error which the program should display as a message to the user before it halts program execution ..

    output specification -- output the time in 12-hour notation using the following format 1:00 PM using a colon to separate the hour part from the minute part and adding the abbreviations AM or PM to indicate what part of the day it is .. Note that you must observe the 2-digit display .. :)

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice