C Programming and Technical Programming Output

Consider the following code:

function modify(a,b)
{
integer c, d = 2
c = a*d + b
return c
}

function calculate( )
{
integer a = 5, b = 20, c
integer d = 10
c = modify(a, b);
c = c + d
print c
}

Assume that a and b were passed by value. What will be the output of the function calculate( ) ?

Read Solution (Total 18)

C Other Question

Consider the following code:

function modify(y,z)
{
y = y + 1
z = z + 1
return y - z
}

function calculate( )
{
integer a = 12, b = 20, c

c = modify(a, b);
print a
print space
print c
}

Assume that a and b were passed by reference. What will be the output of the function calculate( ) ?
Input : ABCD
Output :
ABC D
AB CD
A BCD
AB C D
A BC D
A B CD
A B C D