Can we find the smallest of three integers, without using any of the comparison operators....logic please
SpS
34
Posting Pro
Recommended Answers
Jump to Postint a=rand(); int b=rand(); int c=rand(); std::vector<int> vec; vec.push_back(a); vec.push_back(b); vec.push_back(c); std::cout<< *std::min_element(vec.begin(),vec.end())<<std::endl;
not a comparison operator in sight
Jump to Post>Can we find the smallest of three integers, without using any of the comparison operators....logic please
Can we find out why you're interested in such a silly problem? Logic please.
Jump to Postint a=rand(); int b=rand(); int c=rand(); std::vector<int> vec; vec.push_back(a); vec.push_back(b); vec.push_back(c); std::cout<< *std::min_element(vec.begin(),vec.end())<<std::endl;
not a comparison operator in sight
However, there is a comparison operator out of sight!
Jump to PostSilly logic indeed.
All 13 Replies
Stoned_coder
6
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
Ene Uran
638
Posting Virtuoso
bumsfeld
413
Nearly a Posting Virtuoso
SpS
34
Posting Pro
Narue
5,707
Bad Cop
Team Colleague
chrisbliss18
26
Posting Shark
SpS
34
Posting Pro
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
Narue
5,707
Bad Cop
Team Colleague
SpS
34
Posting Pro
aminura
0
Light Poster
SpS
34
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.