hy i have a problem in a Result programe of C++. I want to find 1st,2nd and 3rd position from any number of students. I already have a code to find first three largest element of array but problem is that 2 or 3 students marks can be equal but in this situation my programe is not working please help me.
moaz.amin.37
-12
Junior Poster
Recommended Answers
Jump to Postcan't help you without the code you wrote.
Jump to Postdelete line 2, conio.h is not needed.
replace line 36 with cin.get().
what data did you enter? Your program worked correctly for me
#include<iostream> using namespace std; int main() { int a[10] = { 5, 2, 10, 25, 4, 9, 7, 6, 8, 3 }; int largest_1 …
Jump to PostSo if you have 3 numbers all the same you want the 1st, 2nd and 3d largest to be that same number?
I just tried it -- use <= and >= instead of < and > in each of the if statements.
All 9 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
moaz.amin.37
-12
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
moaz.amin.37
-12
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
moaz.amin.37
-12
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
moaz.amin.37
-12
Junior Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
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.