User Profile

Collapse

Profile Sidebar

Collapse
strange
strange
Last Activity: Jan 14 '09, 04:00 AM
Joined: Jan 14 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • strange
    replied to comparison code in C
    in C
    it is an interview question.I would like to know the answer.
    See more | Go to post

    Leave a comment:


  • strange
    started a topic comparison code in C
    in C

    comparison code in C

    Consider the following code:

    int CheckForZero (int a[], int n)
    {
    int i;

    for (i = 0; i < n; i++) {
    if (a[i] == 0) {
    return (TRUE);
    }
    }
    return (FALSE);
    }


    This code works - but it does a check for every element in 'a' - i.e.
    it does "n" compares and bails early if it finds even one zero element. ...
    See more | Go to post
No activity results to display
Show More
Working...