diff --git a/day9.cpp b/day9.cpp new file mode 100644 index 0000000..46ffc99 --- /dev/null +++ b/day9.cpp @@ -0,0 +1,81 @@ +#include +#include +using namespace std; +int main() +{ + //array use dto store same type of data. which is contigious + int arr[5]; + int size= sizeof(arr)/sizeof(arr[0]); + for (int i=0;i>arr[i]; + } + //to print the output + for (int i=0;i>arr[i]; + } + cout<>max[i]; //take the input + } + + for (int i=0;i<5;i++) + { + if (max[i]>m) + { + m=max[i]; + } + } + cout<<"The maximum element in the array is:"<>arrr[i]; + } + + // + int key; + cout<<"take input number that you want to search:"<>key; + + + //for itertae the loop to find key + for (int i=0;i<5;i++) + { + if (arrr[i]==key) + { + ans=i; + } + } + cout<<"Element at:"<