From e2eb9dfa6cc41420204c0ca32cd4c6755b1a1b2d Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Sun, 5 May 2019 18:10:55 -0500 Subject: [PATCH] Fixed program 2 to sort multiple vectors not only 1 --- final_lang/programas/programa2.fort | 17 ++++++++++++----- final_lang/programas/programa2.fort.out | 7 +++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/final_lang/programas/programa2.fort b/final_lang/programas/programa2.fort index 6ba6aee..bab0552 100644 --- a/final_lang/programas/programa2.fort +++ b/final_lang/programas/programa2.fort @@ -34,9 +34,16 @@ subroutine sort end do end do end subroutine -readDim() -readVec() -sort() -print 'Sorted vector: ' -printVec() +do then + readDim() + readVec() + sort() + print 'Sorted vector: ' + printVec() + print 'Do you want to sort another vector? enter 1 for yes and 0 for no', endline + read temp + if (temp == 0) then + exit + end if +end do end program \ No newline at end of file diff --git a/final_lang/programas/programa2.fort.out b/final_lang/programas/programa2.fort.out index 9041c16..f3cb687 100644 --- a/final_lang/programas/programa2.fort.out +++ b/final_lang/programas/programa2.fort.out @@ -72,3 +72,10 @@ call 2 call 40 print 'Sorted vector: ' call 16 +print 'Do you want to sort another vector? enter 1 for yes and 0 for no' +print endline +read $213 +== $213 0 $11 +gotoF $11 81 +goto 82 +goto 70