User Profile

Collapse

Profile Sidebar

Collapse
aneeshazeez
aneeshazeez
Last Activity: Apr 9 '09, 06:47 AM
Joined: Jan 16 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • aneeshazeez
    replied to comparison code in C
    in C
    Solution 1
    its very simple.
    add one single line
    a[0] = 0;
    only one comparison

    Solution 2
    for (i=0;i<n;i++)
    {
    Sum1 += a[i];
    Sum2 +=(a[i] - 1);
    }
    if((Sum1 - Sum2) != n)
    return TRUE;
    else
    return FALSE;
    only one comparison :)

    so simple so humble :) your PC is not a magician.
    See more | Go to post
    Last edited by aneeshazeez; Jan 16 '09, 08:46 AM. Reason: more solutions

    Leave a comment:


  • aneeshazeez
    started a topic Nested if & Stack
    in C

    Nested if & Stack

    Will the use of nested if in C programming impact the stack usage?
    See more | Go to post
No activity results to display
Show More
Working...