diff --git a/POTD_31_OCT_2024_Largestnumber_in_an_array.cpp b/POTD_31_OCT_2024_Largestnumber_in_an_array.cpp new file mode 100644 index 0000000..b16eb6f --- /dev/null +++ b/POTD_31_OCT_2024_Largestnumber_in_an_array.cpp @@ -0,0 +1,37 @@ +#include + +using namespace std; +void largestnumber(int data, int arr[], int &loc, int &max) + { + + loc = 1; + max = arr[1]; + for(int k=1;k>data; + + int arr[data]; + cout<<"Enter the numbers to be stored in array: "<>arr[i]; + } + + int loc; + int max; + largestnumber(data, arr, loc, max); + cout << "The largest element is " << max << " at position " << loc << "\n"; + + return 0; +}