mockers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Bigger of two numbers :Sachin Sir

4 posters

Go down

Bigger of two numbers :Sachin Sir Empty Bigger of two numbers :Sachin Sir

Post  ballu Sun Feb 01, 2009 10:32 pm

find the bigger of two nmbers without using any built in function or reklational operator
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

Bigger of two numbers :Sachin Sir Empty Re: Bigger of two numbers :Sachin Sir

Post  ramthegreatcv Mon Feb 02, 2009 12:58 am

ramthegreatcv
ramthegreatcv

Posts : 55
Join date : 2009-01-30
Age : 35

Back to top Go down

Bigger of two numbers :Sachin Sir Empty Re: Bigger of two numbers :Sachin Sir

Post  $corpion Mon Feb 02, 2009 1:02 am

#include<stdio.h>
main()
{

int arr[]={3,4};

printf("%d",arr[arr[1]/arr[0]]);
getchar();
}
//take the nos in array and do the above thing...
$corpion
$corpion

Posts : 25
Join date : 2009-01-30
Age : 37

Back to top Go down

Bigger of two numbers :Sachin Sir Empty @scorpion

Post  ballu Mon Feb 02, 2009 2:01 am

heres my solution
int x=3,y=4;
arr[]={y,x}
printf("%d",arr[(x-y)&&2<<31]);
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

Bigger of two numbers :Sachin Sir Empty Re: Bigger of two numbers :Sachin Sir

Post  $corpion Mon Feb 02, 2009 2:48 am

hey ballu bhai..is it working..cause in dev dpp m gettin only 4 as answer...in all the cases..i.e even wen m takin x as 5...

wats the logic basically??
$corpion
$corpion

Posts : 25
Join date : 2009-01-30
Age : 37

Back to top Go down

Bigger of two numbers :Sachin Sir Empty @DUBEY

Post  mnnit.rahul Mon Feb 02, 2009 2:59 am

dubey your answer fails for negative no what if no are -4 and -5

mnnit.rahul

Posts : 51
Join date : 2009-02-01

Back to top Go down

Bigger of two numbers :Sachin Sir Empty Re: Bigger of two numbers :Sachin Sir

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum