Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

C Programming :: Functions

Home > C Programming > Functions > General Questions

21. What is the output of the following 'C' program ?

#include
#define MAX 80
void fun(char *to, char *from)
{
while(*from)
*to++ = *from++;
*to = '\0';
}
int main(void)
{
char str[MAX];
fun(str, "this is a test");
printf("%s",str);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

22. What is the output of the following 'C' program ?

#include
void quiz(int i)
{
if(i>1)
{
quiz(i/2);
quiz(i/2);
}
printf("%d\n", i);
}
int main()
{
quiz(5);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

23. What is the output of the following 'C' program ?

#include
int i = 10;
void f1(void)
{
static int k;
i = 50;
printf("%d\n",k);
}

int main()
{
int j;
f1();
i = 0;
printf("in main %d\n",i);
f1();
printf("after call %d\n",i);
return 0;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

24. What is the output of the following 'C' program ?

#include
void f1(int a)
{
if( a )
f2( a - 1 );
printf("%d", a);
}

void f2(int b)
{
printf(".");
if(b)
f1( b - 1 );
}
int main(void)
{
f1(5);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

25. What is the output of the following 'C' program ?

#include
int DoSomething (int a, int b)
{
if ( b == 0 )
return (a);
else
return (DoSomething(a-1, b-1));
}
int main()
{
printf("%d\n",DoSomething(20,23));
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

26. Which header file should you include if you are to develop a function that can accept variable number of
arguments?

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

27. It is necessary to declare the type of a function in the calling program if the function

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

29. Consider the following program which comprises three source files main.c, fl.c, f2.c? What is the output of the program?

#include
//test.c

void f1 ();
void f2();
static int a;
static int b;
void main()
{
f1 ();
f2();
printf("f5 = %d f6 = %d ", a, b );
}

//f2.c
int a;
int b;
void f2(){
printf("f3 = %d f4 = %d ", a,b);
}

//f1 .c
extern int a;
extern int b;
void f1 ()
{
b = 6;
a= 5;
printf("f1 = %d f2 = %d ", a,b);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Commvault 

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Commvault