adplus-dvertising
frame-decoration

Question

Consider the following program. If abcdefg is the input, the output will be
main() 
 {
 char x[10], *ptr = x;
 scanf("%s", x);
 change(&x[4]);
 } 
 change ( char a[ ] )
 {
 puts(a);
 }

a.

abcd

b.

abc

c.

efg

d.

garbage

Answer: (c).efg

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Consider the following program. If abcdefg is the input, the output will be

Similar Questions

Discover Related MCQs

Q. Pick the correct answers.
If x is an one dimensional array, then

Q. Let x be an array. Which of the following cannot be present in the left hand side of an assignment statement?

Q. Consider the declarations:

char first (int (*) (char, float)) ;
int second(char, float);

Which of the following function invocation is valid?

Q. A function q that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as

Q. If func is a function needing three arguments a1, a2,  a3 then func can be invoked by

Q. The declaration
int (*p) [5];
means

Q. Consider the declaration

int a = 5, *b = &a;

The statement
printf("%d", a * b);
prints

Q. calloc(m, n); is equivalent to

Q. If p is a pointer to an integer and t is a pointer to a character then sizeof (p) will be

Q. Which of the following comments about arrays and pointers is/are not true?

Q. A one dimensional array A has indices 1....75. Each element is a string and takes up three memory words. The array is stored at location 1120 decimal. The starting address of A[49] is

Q. What will be the address of the arr[2][3] if arr is a 2-D long array of 4 rows and 5 columns and starting address of the array is 2000?

Q. The information about an array used in program will be stored in

Q. An array elements are always stored in ________ memory locations.?

Q. Let x be an array. Which of the following operations are illegal?

I. ++x
II. x+1
III. x++
IV. x*2

Q. The reason for using pointers in a C program is

Q. How can you write a[i][j][k][l] in equivalent pointer expression?

Q. What is wild pointer?

Q. Comment on this:
const int *ptr;

Q. Choose the best one.
Prior to using a pointer variable