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 is local and global variable in c?

610


What does c in a circle mean?

572


What are structural members?

564


How can I read data from data files with particular formats?

594


Are there constructors in c?

587






What is the advantage of c?

607


int far *near * p; means

3108


What is sorting in c plus plus?

561


Is c dynamically typed?

662


What are the advantages of c preprocessor?

700


Why is this loop always executing once?

609


Is main is user defined function?

585


Write a program of advanced Fibonacci series.

701


What is the easiest sorting method to use?

629


Write a program to swap two numbers without using third variable in c?

607