C Quick Refresher

Introduction
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;

printf("%d", c);
}


Student
R Purushothaman   01-Dec-22

e

Support Team
Support Team   06-Dec-22

Dear Purusothaman, Array length is always 10 only. You can use the functions like to get the filled values in the array. After that you get the answer. Hope this helps. Thanks.
REPLY

Student
Kalai selvan T S   20-Nov-21

sir! in this you get the input from the user (as n). but we can't use this instead we use 10 in the for loop.

Support Team
Support Team   20-Nov-21

Thanks for your comments.
REPLY