Exforsys
+ Reply to Thread
Results 1 to 4 of 4

minus operator

This is a discussion on minus operator within the C and C++ forums, part of the Programming Talk category; Can Any One Solve This Question...?? Implement Minus '-' operator without Using it........... eg:- i hav to subtract 'b' from ...

  1. #1
    bharat1989 is offline Junior Member Array
    Join Date
    Jan 2010
    Answers
    1

    minus operator

    Can Any One Solve This Question...??
    Implement Minus '-' operator without Using it...........

    eg:-

    i hav to subtract 'b' from a' but i can not use '-'.....reply plz


  2. #2
    shsuen is offline Junior Member Array
    Join Date
    Feb 2010
    Answers
    2
    multiply b by zero

    thank you

    please help me to solve this question

    xxxxxxxxxxxx

    Determine 20 patterns and texts which will result in the worst case performance and create a scattergraph of
    CPU execution time plotted against length(text)*length(pattern). The product, length(text)*length(pattern),
    should be approximately equal to, 102, 104, 106, 108 and 1010, and for each product you should construct 4
    pattern-text examples. As a guide you should ¯nd that the worst case execution time for a product length
    of 1010 is over 10 seconds. The total ¯le size should be no more than 100MBytes. Note: you will need to
    write a simple c program to generate the text and pattern ¯les.

    xxxxxxxxxxxxxxxxx


  3. #3
    shekhar81 is offline Junior Member Array
    Join Date
    Jul 2010
    Answers
    4
    Quote Originally Posted by bharat1989 View Post
    Can Any One Solve This Question...??
    Implement Minus '-' operator without Using it...........

    eg:-

    i hav to subtract 'b' from a' but i can not use '-'.....reply plz
    If you can solve this in future then please tell me.

    Shekhar.


  4. #4
    prasads_025 is offline Junior Member Array
    Join Date
    Jul 2010
    Answers
    1
    We can use Bitwise complement operator

    int a=15,b=10;

    pf("%d", a+(~b+1));


    ans:5


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...