C Programming and Technical Category

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( ) ?

Read Solution (Total 13)

C Other Question

‪#‎include‬
int print(int n)
{
if(n==0)
return 0;
print(n-1);
printf("%dn",n);
}
int main()
{
int n=0,x=3;
n=print(x);
printf("%dn",n);
return 0;
}
explain the o/p?
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( ) ?