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 is a stream water?

771


Differentiate between #include<...> and #include '...'

706


How main function is called in c?

711


What is the use of typedef in c?

677


C language questions for civil engineering

1341






in linking some of os executables are linking name some of them

1763


How to get string length of given string in c?

698


How can you tell whether two strings are the same?

920


What is getch() function?

744


How many data structures are there in c?

705


What are logical errors and how does it differ from syntax errors?

753


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

764


Is there a way to compare two structure variables?

713


Write a program to print "hello world" without using a semicolon?

702


What does 1f stand for?

719