0% found this document useful (0 votes)
8 views1 page

Numbers of Integers

Uploaded by

skab5673
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Numbers of Integers

Uploaded by

skab5673
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1 Program Q2

2
3 implicit none
4 integer,allocatable,dimension(:)::a
5 integer:: i,j,t,n
6
7 write(*,*)"Numbers of integers"
8 read(*,*)n
9 allocate(a(n))
10 read(*,*)(a(i),i=1,n)
11
12 write(*,*)"Sort form"
13 write(*,*)(a(i),i=1,n)
14
15 do i=1,n
16 do j=i,n
17 if (a(i)>a(j))then
18 t=a(i)
19 a(i)=a(j)
20 a(j)=t
21 end if
22 end do
23 end do
24
25 write(*,*)"Ascending Form"
26 write(*,*)(a(i),i=1,n)
27
28 write(*,*)"descending Form"
29 write(*,*)(a(i),i=n,1,-1)
30
31
32 End Program
33

You might also like