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

explain what is an endless loop?

600


How many types of sorting are there in c?

596


What is return in c programming?

503


What is a good data structure to use for storing lines of text?

580


Explain what is the difference between the expression '++a' and 'a++'?

620






Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

732


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2324


What is infinite loop?

618


What does volatile do?

554


Is there any demerits of using pointer?

617


How to compare array with pointer in c?

610


What is the purpose of void pointer?

588


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

2564


If you know then define #pragma?

666


Is it better to bitshift a value than to multiply by 2?

647