| | |
To find which variable is greater
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2009
Posts: 23
Reputation:
Solved Threads: 1
Can anyone tell whats wrong in below code?
I m learning c++ ..so maybe this ll be very easy solution for you guys
I m learning c++ ..so maybe this ll be very easy solution for you guys
C++ Syntax (Toggle Plain Text)
Hello i m learning c++ ..so maybe this ll be very easy solution for you guys #include<iostream.> #include<conio.h> void main() { int a,b,c; clrscr(); cout<<"Enter Your 1st Value"; cin>>a; cout<<"Enter Your 2nd value"; cin>>b; cout<<"Enter your 3rd value"; cin>>c; if(a>b&&c) { cout<<"1st value is greater"; } else if(b>a&&c) { cout<<"2nd value is greater"; } else if(c>b&&a) { cout<<"3rd value is greater"; } getch(); }
Last edited by th3learner; Oct 10th, 2009 at 1:25 pm.
•
•
Join Date: Jan 2008
Posts: 3,844
Reputation:
Solved Threads: 503
1
#3 Oct 10th, 2009
This isn't a code snippet. If possible, please change the thread type to a regular old thread as opposed to a code snippet.
The && operator doesn't work that way. You want something like this:
The && operator doesn't work that way. You want something like this:
C++ Syntax (Toggle Plain Text)
if (a > b && a > c) cout << "First value is the max.";
![]() |
Similar Threads
- Using a method of an object - cannot find variable (Java)
- Cannot find symbol variable - msge (Java)
- cant find the variable (Java)
- Variable pointers or References for .conf parser? (C++)
- Perl Untie Problem (Perl)
- Enabling disable/enable property for LAN connection in limited a/c (Windows NT / 2000 / XP)
- Breaking out of a Loop (Java)
- I need help with this c++ program please!!! (C++)
Other Threads in the C++ Forum
- Previous Thread: whats wrong with my program??help needed for C++ qn
- Next Thread: C++ maskedtextbox (IP address)
Views: 266 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll dynamic encryption error file forms fstream function functions game givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort stream string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






