220 views
0 votes
0 votes
What is the value of m printed by PARAM????

program PARAM(input,output);

var m,n;

procedure P(var xx,y:integer);

var m:integer

begin

      m:=1;

      x:=y+1;

end;

procedure Q(x:integer,var y:integer);

begin

   x:=y+1;

end;

begin //main function

  m:=0

    P(m,m)

    write(m);   

    n:=0;

     Q(n*1,n);

     write(n);

end

According to me answer should be 0 because  m is the actual parameter that corresponds to formal parameter in P......But the answer given is 1.Can someone please explain how 1 would be printed??

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
Pankaj_Kumar asked Nov 28, 2021
414 views
if two variable are declared in different function with same name and static keyword then there will one variable in memory or two different variable [refrence gate 2020 ...
0 votes
0 votes
0 answers
2
Arun Rout asked Nov 29, 2018
413 views
1 votes
1 votes
1 answer
3
Gate Fever asked Oct 29, 2018
514 views
pls explain this;i never get its explanation on GO!
0 votes
0 votes
0 answers
4
rohit vishkarma asked Oct 25, 2018
817 views
Give the output of the following program#include <iostream.h>void main(){int x[]={5,2,6,9,8};int *p, q,*t;p=x;t=x+1;q=&t;cout<<endl<<*++p<<" "<< q<<" "<<*t++;}(a) 1 1 1 1...