Question: I made a program for c++ that works for the most part except for the search function for the array. Here is the Code: #include

I made a program for c++ that works for the most part except for the search function for the array. Here is the Code:

#include #include #include #include using namespace std; int main() { int arr[10],i,temp,j,sum=0; int find,count=0; float avg; char ch; srand(0); printf(" **Random Number array** "); for(i=0;i<10;i++) { arr[i]=14+rand()%10; printf("%d\t",arr[i]); } while(1) { printf(" Enter your choice: P. Position R. Reverse A. Average S. Search Q. Quit Your Choice:"); scanf(" %c",&ch); if(ch=='q' || ch=='Q') break; switch (ch) { case 'p': printf(" Array Element postion "); for(i=0;i<10;i++) { printf(" %d. %d",i,arr[i]); } break; case 'P': printf(" Array Element postion "); for(i=0;i<10;i++) { printf(" %d. %d",i,arr[i]); } break; case 'r': j=i-1; i=0; while(i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!