Arrays max value in array


sir mujhe yehh puchna tha ki iss que mein yehh approch hii chlegi na like for loop use kr ke que mein likha h function chlake value return krni h .

hi @manishayadav1360_c0939b9a17f994ff
yes logic looks good to finding max in array

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Take as input N, the size of array. Take N more inputs and store that in an array. sir , yehh statment ko ek baar explain kr do as mera code compile ho gya h test cases paas ni ho re

do not send the full code but i want to know kii iss statement ko code mein kese convert kru pl help

@manishayadav1360_c0939b9a17f994ff,
the code which u shared was static like value of n and array’s element was given by u but in question it will be given by end user so make dynamic to pass all test cases.

int n;
cin>>n; //take n input
int a[n];
for(int i=0;i<n;i++)cin>>a[i]; // loop and fill array with input

in this way you can take input based upon end user

https://ide.codingblocks.com/s/655561 sir, pl tell mein wrong khha hu

@manishayadav1360_c0939b9a17f994ff check this : https://ide.codingblocks.com/s/655570

@manishayadav1360_c0939b9a17f994ff is the issue resolved??

nopes it is showing incorrect

@manishayadav1360_c0939b9a17f994ff send me modified code and screen shot of question please

how cn i send ss i send code on chat with ta

@manishayadav1360_c0939b9a17f994ff send me complete question (copy paste)

@manishayadav1360_c0939b9a17f994ff, doubt cleared?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.