what is the output of following question?

void main()
{
int i=0,a[3];
a[i]=i++;
printf("%d",a[i]
}

Answer Posted / sha

Vignesh, you are right about the post incerement operation.
The a[i]=a[0] which will be assigned 0 but the printf will
print 0 as output because its printing the a[0] and not a
[1].

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are multidimensional arrays?

656


What is structure in c language?

625


What is the difference between mpi and openmp?

738


What is %g in c?

626


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

768






Can we increase size of array in c?

544


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1594


What does the error 'Null Pointer Assignment' mean and what causes this error?

746


which type of aspect you want from the student.

1704


What is a null string in c?

593


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

587


When should the volatile modifier be used?

689


What is restrict keyword in c?

647


How do we open a binary file in Read/Write mode in C?

685


What is the meaning of && in c?

552