search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
0 votes
9 views
The value of k at the end of the execution of following program:

int increase(int p)

{

 int amount = 0;

amount = amount +p;

return(amount);

}

main( )

{

int i, j, k;

for(i = 0: i < 4; i++)

{

for( j = 0: j <=i; j++)

{

k = increase(j);

}

}

}

A) 4

B) 10

C) 20

D) 6
in Programming 15 points 9 views
0
@subhajit panday

Ans - (A)

1 Answer

0 votes
In the increase () function , amount is initialized to 0 each time it is called. The final value of k will be when i =3 and j=3 .

ans should be 3
11 points
...