help for c program

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2006
Posts: 4
Reputation: chillharsh is an unknown quantity at this point 
Solved Threads: 0
chillharsh chillharsh is offline Offline
Newbie Poster

help for c program

 
0
  #1
Jul 6th, 2006
i kow c up to a good level but i have question for which i am anable to find solution that is to find greatest of 2 numbers in 'c' without using 'if' condition can any one help me out
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: help for c program

 
0
  #2
Jul 6th, 2006
Ternary operator perhaps ?

  1. int a = 1;
  2. int b = 2;
  3.  
  4. int c = ((a > b) ? a : b )
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 4
Reputation: chillharsh is an unknown quantity at this point 
Solved Threads: 0
chillharsh chillharsh is offline Offline
Newbie Poster

Re: help for c program

 
0
  #3
Jul 6th, 2006
thanks
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 89
Reputation: dilip.mathews is an unknown quantity at this point 
Solved Threads: 3
dilip.mathews's Avatar
dilip.mathews dilip.mathews is offline Offline
Junior Poster in Training

Re: help for c program

 
0
  #4
Jul 7th, 2006
Is there any other way (I mean using bitwise operators) ???
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 888 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC