Explore
ProGrad Programs
About Us

Edit
Reply




Edit

Program to check if two arrays are equal or not | FACE Prep

Published on 11 Mar 2020

Program to check if two arrays are equal or not is discussed here. Given two arrays, display "Same" if both the arrays are equal. Else, display "Not Same".


Input format:


  • Input consists of 2 integers and 2 arrays.
  • Integers correspond to the size of arrays.
  • If two arrays are same, display "Same" else display "Not Same"


Sample Input:


3

3

1

2

3

1

2

3


Sample output:


Same


Algorithm to check if two arrays are equal or not


  • Input the number of elements of arr1 and arr2.
  • Input the elements of arr1 and arr2.
  • If all the elements of arr1 and arr2 are equal, then print "Same".
  • Else, print "Not Same".


Program to check if two arrays are equal or not


C
C++
Java
Python 3

Output
4 4
1 2 3 4
4 2 3 4
Not same


Recommended Programs





If you have any feedback about this article and want to improve this, please write to enquiry@faceprep.in