what is the output of following question?

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

Answer Posted / vignesh1988i

my opinion or wat i think is that ,
a[i]=i++; is given so...

here i++ is a post increment operation , so first it will assign the value to a[0]=0 , so a[0] will have 0 , and in next line a[i] is given in printf , so the value a[1] should get printed that will be garbage value.......


thank u

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are static variables in c?

631


What are directives in c?

550


What does malloc () calloc () realloc () free () do?

563


What is data structure in c programming?

576


Why is c not oop?

541






What is integer constants?

626


What is the right way to use errno?

625


Is there anything like an ifdef for typedefs?

706


What is data structure in c and its types?

598


What is c preprocessor mean?

797


What is wrong with this code?

698


How can you convert integers to binary or hexadecimal?

621


Explain a pre-processor and its advantages.

636


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

683


How can I find the modification date and time of a file?

606