On 12/29/2009 12:55 AM, Arvind Balodia wrote:
>
> i have just given the idea not a function code.
> an idea without using the if, loop and ternary operator.
> if 0 and 1 output you are taking as problem.
> So remember your first lesson of computer.
> this machine runs on just these two logical states 0 and 1.
> i dont want to debate just to give an idea for solution.
>
> ________________________________
> From: John <[email protected] <mailto:jm5678%40gmail.com>>
> To: [email protected] <mailto:c-prog%40yahoogroups.com>
> Sent: Mon, December 28, 2009 11:38:24 PM
> Subject: [c-prog] Re: Getting Biggest number of two.
>
> --- In c-p...@yahoogroups. com, Arvind Balodia <arvind.balodia@ ...> 
> wrote:
> >
> > boolean myfunc(int a,int b)
> > return a>b;
>
> But that just returns 0 or 1. The OP wants a function to return the 
> biggest of 2 arguments.
>
> [Non-text portions of this message have been removed]
>
Dear Arvind,
actually i was looking for some idea which would return the "biggest" 
number. may be we can write a code with your idea of using 0 or 1 for 
deciding which number is biggest, i am doing it in my way as follows:

int biggest(int a, int b) {
     int arr[2];
     arr[0] = a;
     arr[1] = b;

     return arr[a<b];
}

Regards

anup

PS: can the above code also be used in obfuscating the programs?




[Non-text portions of this message have been removed]

Reply via email to