C Language MCQ - English
In C, if you pass an array as an argument to a function, what actually gets pass
Home | Discussion ForumIn 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 : C
View More Related Question
1) In C Programming, If we need to store word "INDIA" then syntax is as below –
char name[6] = {'I','N','D','I','A'};
char name[6] = {'I','N','D','I','A','\0'}
char name[6] = {"I","N","D","I","A"}
name = "INDIA"
View Answer
2) What will be the output of the program ? #include<stdio.h>
int main()
{
int a[5] = {51, 1, 5, 20, 25};
int x, y, z;
x = ++a[1];
y = a[1]++;
z = a[x++];
printf("%d, %d, %d", x, y, z);
return 0;
}
3) What does the following declaration mean?
int (*ptr)[10];
ptr is array of pointers to 10 integers
ptr is a pointer to an array of 10 integers
ptr is an array of 10 integers
ptr is an pointer to array
View Answer
4) What will be the output of following program code?
#include <stdio.h>
int main(void)
{
char p;
char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8};
p = (buf + 1)[5];
printf("%d", p);
return 0;
}
5) What is the maximum number of dimensions an array in C may have?