Vyom World.com Let's Touch the Sky Together!
 Home VyomWorld.com Home Free Magazines! VyomLinks.com Home JobsAssist.com Home Vyom Network Contact Us Jobs & Careers Resume Submitter Placement Papers IT Companies Directory Computer Jobs Interview Questions Online Exams Vyom Career eMag. Fun Screensavers New! Send FREE SMS! SMS Jokes Source Codes Library Source Codes Home ASP Source Codes C Source Codes C++ Source Codes COBOL Source Codes Java Source Codes Pascal Source Codes Submit Source Codes GATE GATE an Overview GATE Preparation Study Materal GRE GRE an Overview GRE Questions GRE Preparation GRE Universities TOEFL Preparation TOEFL Resources GMAT Preparation GMAT Resources MBA Preparation MBA Resources Networking Concepts Networking Concepts Testing Preparation Testing Resources Webmasters Free Traffic Builder Webmaster Articles Web Hosting Tutorials Hardware Tutorial 1500 Free eBooks New! FREE Publications
Vyom Career eMag.
 Get 9,000+ Interview Questions & Answers in an eBook. 9,000+ Interview Questions All Questions Answered 5 FREE Bonuses Free Upgrades Get it now!
Get 9,000+ Interview Questions with Answers in an eBook

Home >> Source Codes Library Home >> Language Home >> Category Home > > Item Description
Search Code Library

 Title Randomizes two 3x3 arrays and indicates the numbers whih are common in both the arrays otherwise an cross 'x' is shown instead. Description: Hits: 2359 Since 25th November, 2003 Code: Select and Copy the Code { Description: Randomizes two 3x3 arrays and indicates the numbers whih are common in both the arrays otherwise an cross 'x' is shown instead. } program randomarray; uses crt; type arr1 = array [1..3,1..3] of integer; var a1, a2, a3 : arr1; i, j : integer; procedure initialise1(var a_1 : arr1); begin for i:=1 to 3 do begin for j:=1 to 3 do begin a_1[i][j]:=random(10); end; end; end; procedure initialise2(var a_2 : arr1); begin for i:=1 to 3 do begin for j:=1 to 3 do begin a_2[i][j]:=random(10); end; end; end; procedure output1(var a_1 : arr1); begin for i:=1 to 3 do begin for j:=1 to 3 do begin write(a_1[i][j],' '); end; writeln; end; end; procedure output2(var a_2 : arr1); begin for i:=1 to 3 do begin for j:=1 to 3 do begin write(a_2[i][j],' '); end; writeln; end; end; procedure same(var a_1, a_2 : arr1); begin for i:=1 to 3 do begin for j:=1 to 3 do begin if a_1[i][j] = a_2[i][j] then write(a_1[i][j],' ') else write('x '); end; writeln; end; end; begin clrscr; randomize; initialise1(a1); initialise2(a2); output1(a1); writeln; output2(a2); writeln; same(a1,a2); readln; end.

ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home