programs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ash4640

    #1

    programs


    How do I write hese programs in c Iam a beginner learning c.
    1.
    write a program to read 2 inetegers with the following signficance th
    first integer value represents a time of day on a 24hour clock, so tha
    1245 represents quater to one mid-day for eg. The second intege
    represents a time duration in a similar way, so that 345 represent
    three hours & 45 minutes. This duration is to be added to the firs
    time, and the result printed out in the same notation, in this cas
    1630 which is the time 3hours and 45 minutes after 1245.
    Typical output might be start time is 1415. Duration is 50 End time i
    1505.

    2.
    write a function that takes 2 numbers in decimal format. The secon
    number has to be lesser than 32. Right shift & left shift the firs
    number by the second number and display the input & output (righ
    shifted and left shifted) in binary format.

    3.
    Implement a file copy utility with silent and verbose mode.

    Ash


    -
    ash464
    -----------------------------------------------------------------------
    Posted via http://www.codecomments.co
    -----------------------------------------------------------------------

  • Rich Grise

    #2
    Re: programs

    ash4640 wrote:[color=blue]
    >
    > How do I write hese programs in c Iam a beginner learning c.[/color]

    In C, of course. You could use pen/pencil and paper, or a text editor on
    a computer - actually, to _write_ a program, and not just enter it, you
    should design it first. You have a pretty good spec here.

    You can write it quickly, you can write it slowly. You can write
    it simply, or in a complex fashion. Exactly how you go about writing
    the program is entirely up to you. Ain't computers grand?
    [homework assignment snipped]

    Cheers!
    Rich

    Comment

    • osmium

      #3
      Re: programs

      ash4640 writes:
      [color=blue]
      > write a function that takes 2 numbers in decimal format. The second
      > number has to be lesser than 32. Right shift & left shift the first
      > number by the second number and display the input & output (right
      > shifted and left shifted) in binary format.[/color]

      Set aside the requirement for binary output for now. What would the result
      look like if the two input numbers were 123.456 and 2.3 after a right shift
      with the output in decimal? Would this have any real world meaning? Keep
      in mind that there is no mathematical function called "shift", it is a
      computer term. And that decimal numbers are inherently stored in a
      distinctly non-decimal form in computers unless you go to great lengths to
      do otherwise.


      Comment

      • jacob navia

        #4
        Re: programs

        Lazyness will lead you nowhere.

        Do your homework yourself, it is the only way of learning.



        Comment

        Working...