Advertisements
Advertisements
प्रश्न
Write a C++ program to input ‘n’ elements in an one dimensional array and input one another number and check whether this number is present in the array or not.
कोड लेखन
Advertisements
उत्तर
#include <iostream.h>
main()
{
int i, n, n1 x(10), p = 0;
cout "Enter the value of n";
cin>>in;
cout<<"/n Input Elements";
for (i - 1< = ic - n ; i++)
cin>>x[i];
cout<<:\n Enter the number to be cheek";
cin>>h1;
for (i = 1; i< = n ; i++)
{
it (n1 = = x[i])
P = 1;
}
if (P = = 0)
count<<"\n No is not found";
else
cout<<"in No is found";
return(0);
}shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
