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
What is the difference between null pointer and wild pointer?
Explain what is page thrashing?
What is the meaning of && in c?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What is clrscr in c?
What is const volatile variable in c?
What is the difference between break and continue?
How does free() know explain how much memory to release?
what type of questions arrive in interview over c programming?
Why c is known as a mother language?
Can you mix old-style and new-style function syntax?
What is the significance of c program algorithms?
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.
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are structural members?