Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions