1.  The following program
main()
{
static char a[3][4] = {''abcd'', ''mnop'', ''fghi''};
putchar(**a);
}


will not compile successfully
results in run-time error
prints garbage
none of the above


Answer

 Option

*a points to the string "abcd".**a is the first character of "abcd", which is the character 'a '

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

2.  Under which of the following conditions, the size of an one-dimensional array need not be specified ?


when initialization is a part of definition
when it is a declaration
when it is a formal parameter and an actual argument
all of the above


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

3.  Which of the following is correct way to define the function fun() in the below program ?
#include
int main()
{
int a[3][4];
fun(a);
return 0;
}


void fun(int p[][4])
{
}

void fun(int *p[4])
{
}

void fun(int *p[][4])
{
}

void fun(int *p[3][4])
{
}


Answer

 Option

void fun(int p[][4]){ } is the correct way to write the function fun(). while the others are considered only the function fun() is called by using call by reference.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

4.  Consider the statement
int val [2] [4] = {1, 2, 3, 4 , 5, 6, 7, 8};
4 will be the value of


val[0][3]
val[0][4]
val[1][1]
none of the above


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

5.  In C, if you pass an array as an argument to a function, what actually gets passed?


Value of elements in array
First element of the array
Base address of the array
Address of the last element of array


Answer

 Option

The statement 'C' is correct. When we pass an array as a funtion argument, the base address of the array will be passed.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report