#include<stdio.h>
int main()
{
int i=2;
int j=++i + ++i + i++;
printf("%d\n",i);
printf("%d\n",j);
}
Answer Posted / vadim g
i=5 and j=12
Here is the sequence of operations:
1. i = 2 => result i = 2
2. first ++i => result: i = 3
3. second ++i => result: i = 4
4. j assignment => result: j = 4 + 4 + 4 = 12
5. i post increment => i = 5
MSVC++ gives 5 and 12.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
Write a code of a general series where the next element is the sum of last k terms.
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
Is c is a middle level language?
Tell me what are bitwise shift operators?
What is memcpy() function?
What is function and its example?
What is a nested formula?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is the c language function prototype?
Is null always equal to 0(zero)?
What is a lvalue
int i=10; printf("%d %d %d", i, i=20, i);
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
write a program to rearrange the array such way that all even elements should come first and next come odd