63 200
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #20913 in C++ for zaima hussain

Question #20913
write a program in c++ that will input random floating values in an array using an user defined functions. Using another user defined functions search user input floating point number in the input array, the program output the position of the number in the array otherwise display a message that the number is not in the list.
Expert's answer

#include <iostream>
#include <conio.h>
#include <time.h>
using namespace std;

//main function
int main()
{
srand (time (NULL));
int arraofnumbers[100];

for(int i=0;i<100;i++){
arraofnumbers[i]=rand()1;
}


int number=0;
cout<<"Enter number: ";
cin>>number;
for(int i=0;i<100;i++){
if(number==arraofnumbers[i]){
cout<<arraofnumbers[i]<<" ";
}
}
getch();
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions