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 array in C
What are the 32 keywords in c?
Can two or more operators such as and be combined in a single line of program code?
What are local variables c?
Explain a pre-processor and its advantages.
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What does %p mean?
What are the types of functions in c?
What is double pointer?
why programs in c are running with out #include
What is difference between %d and %i in c?
Why c is called free form language?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
Explain what is #line used for?