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
How can I manipulate individual bits?
What is the purpose of 'register' keyword in c language?
Why does notstrcat(string, "!");Work?
What is actual argument?
What is the difference between typedef struct and struct?
Explain what is meant by 'bit masking'?
What is #include conio h?
What is the use of function overloading in C?
What is a lvalue
Difference between macros and inline functions? Can a function be forced as inline?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
What is the best way of making my program efficient?
How do you use a pointer to a function?
Is sizeof a keyword in c?
Can two or more operators such as and be combined in a single line of program code?