•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 402,624 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,182 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 1733 | Replies: 13
![]() |
•
•
Join Date: Jul 2005
Location: London
Posts: 164
Reputation:
Rep Power: 4
Solved Threads: 5
int 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;
>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.
Can we find out why you're interested in such a silly problem? Logic please.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
•
•
•
•
Originally Posted by Stoned_coder
not a comparison operator in sightint 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;
•
•
•
•
Originally Posted by Narue
>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.
•
•
•
•
Originally Posted by bumsfeld
silly logic indeed
Hey cmon guys...i don't have a leg-pull function as friend.....i am just trying to solve some c - puzzles
It's funny, but almost all of sunnypalsingh's questions sound like questions that an idiot teacher would ask. Knowing the answer to such questions doesn't help anyone understand programming and definately doesn't help a programmer develop good technique.
Did we help you? Did we miss the point entirely? Update your thread and let us know.
Don't like the answers you are getting?
Did you try searching?
Clean up and optimize Windows 2000/XP
Don't like the answers you are getting?
Did you try searching?
Clean up and optimize Windows 2000/XP
•
•
•
•
Originally Posted by chrisbliss18
It's funny, but almost all of sunnypalsingh's questions sound like questions that an idiot teacher would ask. Knowing the answer to such questions doesn't help anyone understand programming and definately doesn't help a programmer develop good technique.
Actually, I have had this sort of question, and it was appropriate for the class I was taking. It doesn't help anyone understand programming, but it helps some understand how integers are represented, or why they are represented the way that they are.
•
•
•
•
Originally Posted by sunnypalsingh
bcoz i was not able to do it
Really? How long did you try? If you tried again for the same length of time, would you necessarily not be able to solve the problem then? If you can't be creative enough and effortful enough to solve this problem, how will you ever be creative enough to come up with solutions to harder problems?
The benefit of this problem is that in solving it, you'll improve your creativity. Yes, creativity is learned. Well, conditioned, maybe. At least the problem-solving kind of creativity is. Anyway, this skill is important to your ability in the arena of computer programming, and you might as well get good at it now, or else you'll suck forever.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the C++ Forum
- Previous Thread: continued new and malloc
- Next Thread: virtual methods and inheritance



Linear Mode