Write a program that allows to test the equality between two tables of integers (sizes 10). The program displays TRUE if the components of the two tables match position by position, otherwise it displays FALSE.

******** In Algorithm ********

Algorithm Variables T1[10], T2[10],i,test: integers Begin

test ← 1 for i from 1 to 10 read(T1[i]) next_for

for i from 1 to 10 f read(T2[i]) next_for

for i from 1 to 10 if( T1[i] ≠ T2[i]) then test ← 1 next_if next_for if( test = 0) then write("TRUE") else write ("FALSE") next_if End Result ==> 1 2 7 9 0 3 1 8 4 6 1 2 7 5 0 3 1 8 4 6 FALSE

******** In language C ********

#include <stdio.h> int main () { int T1[10] ,T2[10], i, test=0, M ; for(i=0 ; i<10 ; i++){ printf("Enter T1[%d]=",i); scanf ("%d",&T1[i]); } printf("\n"); for(i=0 ; i<10 ; i++){ printf("Enter T2[%d]=",i); scanf ("%d",&T2[i]); } for(i=0 ; i<10 ; i++) { if ( T1[i] != T2[i]) test =1 ; } if (test == 0) printf(" ** TRUE **"); else printf (" ** FALSE **"); return 0 ; }


******** In C++ ********

#include <iostream> using namespace std; int main () { int T1[10] ,T2[10], i, test=0, M ; for(i=0 ; i<10 ; i++){ cout<<"Enter T1["<<i<<"]="; cin>>T1[i]; } cout<<endl; for(i=0 ; i<10 ; i++){ cout<<"Enter T2["<<i<<"]="; cin>>T2[i]; } for(i=0 ; i<10 ; i++) { if ( T1[i] != T2[i]) test =1 ; } if (test == 0) cout<<" ** VRAI **"; else cout<<" ** FAUX **"; return 0 ; }