If a function is defined as static, it means

Loading

Practice Functions – If a function is defined as static, it means

Is there any difference between following declarations?

A

Loading

Practice Functions – Is there any difference between following declarations?

A : extern int fun();
B : int fun();

Is there any difference int the following declarations?

i

Loading

Practice Functions – Is there any difference int the following declarations?

int fun(int arr[]);
int fun(int arr[2]);

What will be output of the following “c” code?

Loading

Practice Functions – What will be output of the following “c” code?


#include
int main(){
int i=3,val;
val=sizeof (f(i)+ +f(i=1)+ +f(i-1));
printf("%d %d",val,i);
return 0;
}
int f(int num){
return num*5;
}

In C, if you pass an array as an argument to a function, what actually

Loading

Practice Functions – In C, if you pass an array as an argument to a function, what actually gets passed?

What will be the output of the following program.

Loading

Practice Functions – What will be the output of the following program.


#include
int AX = 0;
int main()
{
int i=0;
i = abc();
printf("%d",i);
return 0;
}
abc()
{
AX = 1000;
return AX;
}

What is the following summation fuction doing?

Loading

Practice Functions – What is the following summation fuction doing?


void summation (n)
int n;
{
int i; sum = 0;
i = 1;
for(i = 1; i < = n; i++)
sum+= i;
}

What is the following test function computing?


Loading

Practice Functions – What is the following test function computing?


int test (n)

int n;

{

int i;

long int prod = 1;

if(n > 1)

for (i = 2; i < = n; i++)

prod *= i

return (prod);

}

If x and y are variables as declared below.



Loading

Practice Functions – If x and y are variables as declared below.

double x = 0.005, y = – 0.01;

what is the value of ceil (x + y), where ceil is a function to compute ceiling of a number?

What is the following program doing?

			  		

Loading

Practice Functions – What is the following program doing?


void main()
{
int digit = 0;
do
printf ("%d/n", digit++);
while (digit < = 9);
}

What is the output of the following problem ?

Loading

Practice Functions – What is the output of the following problem ?


#include

int main() {
int factorial(int n);
int i,ans;
ans = factorial(5);
printf("
Factorial by recursion = %d
", ans);
return 0;
}
int factorial(int n)
{
if (n <= 1)
return (1);
else
return ( n * factorial(n-1));
}

What is the output of the following problem ?


Loading

Practice Functions – What is the output of the following problem ?


#include

int main()

{

int j;

for(j=0;j<3;j++)

foo();

return 0;

}

foo() {

static int i = 10;

i+=10;

printf("%d",i);

}

What is the output of the following problem ?

Loading

Practice Functions – What is the output of the following problem ?


#include
int main()
{
int j,ans;
j = 4;
ans = count(4);
printf("%d
",ans);
return 0;
}
int count(int i)
{
if ( i < 0)
return(i);
else
return( count(i-2) + count(i-1));
}