main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++;
printf("%d", num[i]);
}

what will be the output?
}

Answer Posted / pragathi

3 is the answer bcoz
i=1
num[i]=i++;
num[1]=2;
here i=2
printf("%d", num[2]);

here 3 is there at position 2 .
so answer is 3

Is This Answer Correct ?    19 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we initialize extern variable in c?

632


Can we compile a program without main() function?

634


What is the purpose of type declarations?

680


What is c variable?

552


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

9656






Explain what happens if you free a pointer twice?

613


What is the value of c?

572


What is the translation phases used in c language?

636


Write a program for Overriding.

688


Can you write the function prototype, definition and mention the other requirements.

662


How many levels of pointers can you have?

705


Can you write a programmer for FACTORIAL using recursion?

614


How can I make sure that my program is the only one accessing a file?

678


What is call by value in c?

558


What are the 4 types of unions?

609