|
||||||
| Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Dear Friends,
Anyone pls reolve mentioned problem............. Code:
#!/usr/bin/perl
@data=N;
$sum=0;
print"enter the required No. of numbers to be inputed : f";
$N=<STDIN>;
print"enter the number";
for($i=0;$i<$N;$i+=1)
{$data[$i]=<STDIN>;
# chomp $data[$i];
$sum=$sum + $data[$i];}
# for($j=0;$j=$data[$i];$j+=1)
print"the entered numbers are",@data,"\n";
print"sum of the number:",$sum,"\n";
print"Average value the numbers:",$sum/$N,"\n";
@sorting=sort(@data);
$lengt=@data;
for ($j=0;$j < $lengt;$j++)
{# print $sorting[$j],"\n";
}
$X= (@sorting[($j-1)/2]+ @sorting[$j/2])/2;
print"the median is :$X";
ascending order (for even numbers of values it is your choice to pick the first or second of the middle numbers. Last edited by v0id; 02-12-2008 at 07:01 AM. |
| Sponsored Links |
|
|
|
|||||
|
so what's your problem?
__________________
Visit My Google Group Here: Web Development Innovation |
|
|||||
|
I'd still like to know what your question is. You posted your code, along with a comment, but never asked a question.
__________________
Visit My Google Group Here: Web Development Innovation |
| Sponsored Links |
|
|
|
|||||
|
that's what it sounds like to me too.
__________________
Visit My Google Group Here: Web Development Innovation |
|
|||||
|
lol, I agree....I really like the misspelling of the word "length".
__________________
Visit My Google Group Here: Web Development Innovation |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unique & Complex Sorting Program | ryan.devani | C and C++ | 3 | 01-17-2008 12:28 PM |
| Help with Square root and calculator program!!! | 123456789asdf | C and C++ | 10 | 12-02-2007 04:35 PM |
| Weird problem with code, functions when not suppose to | Murph-s | C and C++ | 0 | 05-14-2007 07:11 PM |