Help with find highest and smallest number in a file with c
Input file:
Desired result:
code that I try but failed to archive my goal
When reading the input file, calculate the length of each "#".
From the above input file, the length is 4,3,7,1.
Thus, highest number is 7 and smallest is 1.
Many thanks for any advice
Hi,
I have a file a.txt and it has values in it
Eg :-
I need to read through the file and find the number that is the greatest in them all.
Can any one assit me on this.
Thanks (30 Replies)
Hi All,
My script is reading a log file line by line
log file is like ;
19:40:22 :INFO Total time taken to Service External Request---115ms
19:40:25 DEBUG : Batch processed libdaemon.x86_64 0-0.10-5.el5 - u
19:40:22 INFO Total time taken to Service External Request---20ms
19:40:24... (4 Replies)
Hey. This is pretty easy stuff but I'm learning the basics of Unix at the moment so keep that in mind. I have to:
1) Write a C-shell script to monitor user activity on the server for 13 minutes.
2) Then print the smallest and largest number of users during these 13 minutes.
I have this:
1)... (2 Replies)
Hi All,
My file looks some thing like this,
File 1: -
A 10
B 30
C 5
D 25
E 72
F 23
now my requirement is to find the line with highest number in it, i;e the result should be
E 72
Thanks in Advance (1 Reply)
Hello
Wondering if anybody may be able to advise on how I can filter the contents of the following file:
<object_name>-<version> <Instance>
GM_GUI_code.fmb-4 1
GM_GUI_code.fmb-5 1
GM_GUI_code.fmx-4 ... (7 Replies)
i have a problem i am working on and am completely new to bash commands. I writing a script to read another file and output the max and Min number in the script. I must use variables to output the max and min numbers. grades = file with numbers in them.
This is what i got so far. Thank You in... (3 Replies)
Hello All,
I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns.
I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions.
If I... (11 Replies)
Hello all, I am new to this and need some help or maybe steer me to the right direction!
I wrote a script to get the highest number and prints it on the screen, the script basically asks the user to input numbers, and then prints the highest number! very simple
it works like this
$sh max.sh... (8 Replies)
In the game of “Unique”, multiple players privately choose an integer. They then reveal
their choice. The winner is the player who chose the smallest unique number. The
game is considered a draw if no unique integer was chosen.
You would write a program that simulate such a game according to the... (1 Reply)
Discussion started by: dantesma
1 Replies
LEARN ABOUT REDHAT
fcvt_r
ECVT_R(3) Linux Programmer's Manual ECVT_R(3)NAME
ecvt_r, fcvt_r, qecvt_r, qfcvt_r - convert a floating-point number to a string
SYNOPSIS
#include <stdlib.h>
char *ecvt_r(double number, int ndigits, int *decpt, int *sign, char *buf, size_t len);
char *fcvt_r(double number, int ndigits, int *decpt, int *sign, char *buf, size_t len);
char *qecvt_r(long double number, int ndigits, int *decpt, int *sign, char *buf, size_t len);
char *qfcvt_r(long double number, int ndigits, int *decpt, int *sign, char *buf, size_t len);
DESCRIPTION
The functions ecvt_r, fcvt_r, qecvt_r and qfcvt_r are identical to ecvt, fcvt, qecvt and qfcvt, respectively, except that they do not
return their result in a static buffer, but instead use the supplied buf of size len. See ecvt(3) and qecvt(3).
NOTES
These functions are obsolete. Instead, sprintf() is recommended.
CONFORMING TO
These functions are GNU extensions.
SEE ALSO ecvt(3), qecvt(3), sprintf(3)GNU 2002-08-25 ECVT_R(3)