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

what will be the output?
}

Answer Posted / ismail

2 is the ans

num[i]=i++
num[1]=2

now num[1] is changed with 2(same as the previous value)
now to print num[i]=num[1] right?
its 2 which is in num[1] solved!!!!

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can insert comments in a c program?

630


Write a program to check whether a number is prime or not using c?

575


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

655


What are the different data types in C?

729


Describe the header file and its usage in c programming?

616






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

617


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

1511


What is the use of header files?

603


What is a structural principle?

639


Can we increase size of array in c?

539


can any one provide me the notes of data structure for ignou cs-62 paper

1702


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

612


Why is %d used in c?

562


why do some people write if(0 == x) instead of if(x == 0)?

654


What are runtime error?

625