Website

Default Image

#include

using
namespace std;


int
main()


{


int
n;


int
x;


cout<<"enter
size of array"<


cin>>n;


int
arr[n];


if
(n < 1 || n > 100)


{



cout << "out of
ranges" << endl;



return 1;


}






//int
arr[n];






for(int
i=0;i


{



cout<<"enter
element of array"<



cin>>arr[i];


}



for(int i=0;i


{



cout<


}


cout<<"enter
the value you want to replace"<


cin>>x;




for(int
i=0;i


{



if(arr[i]==x)



{



arr[i]=-1;



}


}



for(int i=0;i


{



cout<


}


return
0;






}



Read Count: 6 times

Comments

No comments yet.

Leave a Comment