{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

question2 - findUnordered(nums 6,ptr if(ptr==NULL...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> using namespace std void findUnordered(double arr[],int n, double *&pBad) { for(int k =1 k<n k++) { if (arr[k]>arr[k-1]) { pBad=arr+k return } } pBad=NULL } int main() { double nums[6]={45.3, 47.9, 25.8,80.4,15.3,2.5} double *ptr
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: findUnordered(nums, 6,ptr) if (ptr==NULL) { cout<<"The array is ordered"<<endl } else { cout<<"The disorder is at address"<<ptr<<endl cout<<"It's at index"<<ptr-nums<<endl cout<<"The item's value is"<<*ptr<<endl } }...
View Full Document

{[ snackBarMessage ]}