php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The number in two arrays after taking these number the array
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#2
Dear Student,
Below is the modified code for array comparison.

#include<iostream.h>
#include<conio.h>
main()
{
int num1[5];
int num2[5];
int i;
int equals=0;

cout<<"PLEASE ENTER THE NUMBER"<<endl;

for (i=0;i<5;i++)
{

cin>>num1[i];

}


for (i=0;i<5;i++)
{

cout<<num1[i];

}

cout<<endl;

cout<<"PLEASE ENTER THE NUMBER"<<endl;

for (i=0;i<5;i++)
{
cin>>num2[i];
}

for (i=0;i<5;i++)
{
cout<<num2[i];
}

for ( i = 0 ; i < 5 ; i ++ )
{
if ( num1 [ i ] != num2 [ i ] )
{

cout << "\n The arrays are not equal " ;
equals = 0 ;
break ;
}
equals = 1;
}

if (equals)
cout << "\n Both arrays are equal" ;

system("pause");
}
Reply


Messages In This Thread
The number in two arrays after taking these number the array - by Support - 04-24-2011, 06:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  array project code c++ 2011 Vuhelper 0 1,330 12-10-2011, 06:32 PM
Last Post: Vuhelper
  Linked list using arrays? Vuhelper 0 2,418 11-05-2011, 05:07 PM
Last Post: Vuhelper
  Read data from file into arrays in c++ 2011 Vuhelper 0 961 07-20-2011, 10:58 PM
Last Post: Vuhelper
  get length of a dynamic array in c++ 2011 Vuhelper 0 922 07-20-2011, 10:50 PM
Last Post: Vuhelper
  Multidimensional Array vs If-Statements and Functions? in c++ Vuhelper 0 892 07-20-2011, 10:45 PM
Last Post: Vuhelper
  C++ stringstream array to int in c++ 2011 Vuhelper 0 2,525 07-19-2011, 06:35 PM
Last Post: Vuhelper
  adding rows and columns of a multi array in c++ 2011 Vuhelper 0 1,115 07-12-2011, 11:03 PM
Last Post: Vuhelper
  Passing 2d array by reference June 2011 Vuhelper 0 970 06-19-2011, 06:11 PM
Last Post: Vuhelper
  Passing into function array of matrix in c++ 2011 Vuhelper 0 2,570 06-15-2011, 06:24 PM
Last Post: Vuhelper
  C++ Guessing Game include Number and ABC Vuhelper 0 1,343 06-15-2011, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support