473,513 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c program to display first 10 largest numbers present in a file

1 New Member
there is a file contains only a numbers ,we dont know how many numbers present in that file.so i want a program to display top n largest number present in that fie.(n may be 5,10,12 like that.)
Oct 15 '12 #1
3 1920
Meetee
931 Recognized Expert Moderator Contributor
You will have to compare every number with the earlier number and put the largest and smallest in two variables, run this loop till the end of file.
Oct 15 '12 #2
nextstep
14 New Member
it is similar to sort algorithm. you could take a look to them for more reference. i think that you can reuse some code after
Oct 15 '12 #3
sgayathri2412
8 New Member
go on for quick sort or bubble sort algorithms but if there are too many datas,then go for merge sort
Oct 25 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1757
by: D.M | last post by:
Hye, I have a form with 8 telephone number fields. I want to take only first two numbers and make a new field called network group. Please can you help me? Thanks
19
8557
by: ramu | last post by:
Hi, I have, suppose 1000 numbers, in a file. I have to find out 5 largest numbers among them without sorting. Can you please give me an efficient idea to do this? My idea is to put those numbers...
4
2968
by: ghostrider | last post by:
I ned help in figuring out to make my program display even numbers only. My for loop counts every number, but I only need to display the even ones. Can someone help me with this?
25
4342
by: Subra | last post by:
Hi, What is the best way to find the 1000 largest numbers from the file having hell lot of entries ? Can you please help me to find out the way ? Do I need to go for B+ trees ?? Please help,...
7
1608
thatos
by: thatos | last post by:
need help I was trying to do a program which could eliminate numbers which repeats themselves in a list the program below works but it gives me an error can you please try to find the problem as ...
2
2572
by: amulyab | last post by:
Hi all, I want to display the line numbers for the text which resides inside the text field.How can i do this?Please help me.
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.