Say I have 12 number 2,2,2,2,3,4,5,6,7,0,0,0.i want to count the number of 2 from the first end and 0 from the last end ….how can I do it in fortran? say I have 5 lines…and I will have to count the number from each line…as an example I am giving a set of numbers..
2,2,2,2,3,4,5,6,7,0,0,0
2,2,2,6,3,4,5,6,9,0,0,0
2,2,2,2,3,4,5,7,7,0,0,0
2,2,2,5,3,4,5,5,7,0,0,0
2,2,2,7,3,4,5,3,7,0,0,0
Here the answer will be
Number of 2= 4, number of 0=3
Number of 2= 3, number of 0=3
Number of 2= 4, number of 0=3
Number of 2= 3, number of 0=3
Number of 2= 3, number of 0=3
Thank in advance
2,2,2,2,3,4,5,6,7,0,0,0
2,2,2,6,3,4,5,6,9,0,0,0
2,2,2,2,3,4,5,7,7,0,0,0
2,2,2,5,3,4,5,5,7,0,0,0
2,2,2,7,3,4,5,3,7,0,0,0
Here the answer will be
Number of 2= 4, number of 0=3
Number of 2= 3, number of 0=3
Number of 2= 4, number of 0=3
Number of 2= 3, number of 0=3
Number of 2= 3, number of 0=3
Thank in advance