333 views
2 votes
2 votes
int *func(int *p)
{
    int i,m1=0,m2;
    for(i=0;i<5;i++)
    {
        if(*(p+i)>m1)
        {
            m1 = *(p+i);
            m2 =i;
        }
    }
    return (p+m2);    
}

int main(int argc, char const *argv[])
{
    static int arr[5] = {10,20,30,40,50};
    int *pt;
    pt = func(arr);
    return 0;
}

In the above program,when executed, What is the value assigned to "pt" and value of m1, respectively,when program finished executing?

(A) Element of arr,20
(B) Address of arr,30
(C) Address of element of arr,40
(D) Address of element of arr,50

1 Answer

Related questions

1 votes
1 votes
0 answers
1
0 votes
0 votes
3 answers
2
Vasu Srivastava asked Aug 18, 2017
736 views
#include <stdio.h void f(int,int); int main(void){ int a = 5; f(a,a); printf("%d",a); } void f(int x, int y){ x ; y=y+15; }If copy-restore is used, then what will be the ...
1 votes
1 votes
1 answer
3
Vasu Srivastava asked Aug 18, 2017
1,047 views
#include <stdio.h int main(void){ int i=511; char *p = (char *)&i; printf("%d", *p); }OK so why take 2's complement and not simple binary number? Means, why is C giving -...
0 votes
0 votes
1 answer
4
Psnjit asked Jan 12, 2019
1,156 views
main(){unsigned int i= 255;char *p= &i;int j= *p;printf("%d\n", j);unsigned int k= *p;printf("%d", k);} Both the outputs are -1. I have even tried with - int i = 255(3rd ...