Good Programming starts from understanding the existing programs. This is the key reasons, many leading IT companies conduct a "Find the Output" related questions, to easily understand the knowledge level of the candidates.
This chapter is having about 20 such Find the Output questions, most of them are picked from interview questions, and covers all the important concepts like Strings, if, for, while etc.
A sample program is given below:
What is the output of the following program?
int main()
{
int a, b, c; a = 10; b = 20; c = a*a + b*b; c = c * a * b - a - b;
int has 32 bit, and long has 64 bits size to store data. similarly, int has 4 bits for storing data but long has 8 bits for storing data. The memory required to hold the value of type int is less as compared to long.