C Programming and Technical Programming Program

‪#‎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?

Read Solution (Total 19)

C Other Question

On a machine where pointers are 4 bytes long, what happens when the following code is
executed.
main()
{
int x=0,*p=0;
x++; p++;
printf ("%d and %d\n",x,p);
}
a) 1 and 1 is printed
b) 1 and 4 is printed
c) 4 and 4 is printed
d) causes an exception
CHOOSE THE CORRECT OPTION
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( ) ?