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

what will be the output?
}

Answer Posted / tk

Answer is :: 3

Explanation::

main()
{
int i = 1;
int num[] = {1,2,3,4};
num[i] = i++; // Here i = 1, so num[1] = 1; and num =
{1,1,3,4}
// After the execution of this statement the value of i
will be 2 (as i++)
printf("%d", num[i]); // num[2] = 3 so answer is 3
}
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between null pointer and wild pointer?

641


Explain what is page thrashing?

612


What is the meaning of && in c?

550


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1262


What is clrscr in c?

681






What is const volatile variable in c?

579


What is the difference between break and continue?

606


How does free() know explain how much memory to release?

621


what type of questions arrive in interview over c programming?

1559


Why c is known as a mother language?

647


Can you mix old-style and new-style function syntax?

664


What is the significance of c program algorithms?

683


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2652


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

626


What are structural members?

574