two progs are given. one starts counting frm 0 to MAX and
the other stars frm MAX to 0. which one executes fast.

Answer Posted / pritam

this may very well depend upon the architecture of the
underlying hardware.
On most arch though the second one max to 0 will run faster
because almost any sane compiler will optimize the code by
using "not zero" testing machine instruction which is
provided on almost all platforms.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does not c have an exponentiation operator?

623


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

617


Is c still relevant?

635


What is else if ladder?

603


What is difference between structure and union in c?

538






What does %c do in c?

578


How can I get the current date or time of day in a c program?

647


Explain what is output redirection?

661


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist

2513


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

603


How can you determine the maximum value that a numeric variable can hold?

631


How the c program is executed?

625


What is c programing language?

610


Why is structure important for a child?

601


what is uses of .net

1267