Computer Science, asked by hania8711, 4 months ago

Write a program in c++ to input data into an array. Enter the value from keyboard and find out the location of the entered value in the array, if the entered number is not found in the array, Display the message” Number not found”.

Answers

Answered by supriya202050x
1

Answer:

sorry

Explanation:

l don't know the answer...

plz follow me

Answered by aafaaqamir57
0

Answer:

#include<iostream>

using namespace std;

int main()

{

char ans = 'N';

do {

float Array[7];

float check_value;

int location = -1;

cout << "Please enter 7 numbers for array" << endl;

for(int i=0;i<=6;i++){

 cin>>Array[i];

 }

cout << "enter the value to check" << endl;

cin >> check_value;  

for (int i = 0; i <= 6; i++)

{

if (check_value == Array[i])

{

location = i;

}

else {}

}

if (location >= 0)cout << "The check number is in location " << location << " of array" << endl;

else {

cout << "Number Not found" << endl;

}

cout << "Do you want to continue (Y/N)?\n";

cout<< "You must type a 'Y' or an 'N' :";

cin>>ans;

} while ((ans == 'Y') || (ans == 'y'));

return 0;

}

Explanation:

this is the correct answer

Similar questions