Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
File handling. Posted by misj2lleun on 31 Jan 2010 at 12:29 PM
I'm beginner and i need to do that program :

File (input.txt) have three rows and each row has exactly three integers(I need to ask user to enter integers). Establish a program that reads in integers and writes them in reverse order (i need to exchange rows and columns to ) in file output.txt.

Like. If i have numbers :

14 67 34 17 2 89
29 45 32 then ===> 32 45 29
89 2 17 34 67 14

I've done something but i think it's 100% wrong...I've been struggling with that some weeks and i don't know what to do.



Program kt6_2;


var
   row1 : array[1..3] of integer;
   row2 : array[1..3] of integer;
   row3 : array[1..3] of integer;

Begin
   writeln('Enter first row:');
   readln(row1[3]);
   writeln('Enter second row:');
   readln(row[3]);
   writeln('Enter third row:');
   readln(row3[3]);







 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.