programs

A

ash4640

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
 
R

Rich Grise

ash4640 said:
How do I write hese programs in c Iam a beginner learning c.

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
 
O

osmium

ash4640 said:
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.

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.
 
J

jacob navia

Lazyness will lead you nowhere.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,372
Latest member
LucretiaFo

Latest Threads

Top