int funcp(){
static int x = 1;
x++;
return x;
}
int main(){
int x,y;
x = funcp();
y = funcp() + x;
printf("%d\n", (x+y));
return 0;
}
Step 1: Track the lifetime of variables
The variable declared inside funcp() has static storage duration. This means its memory is allocated once and its value persists between calls. The variable is initialized only on the first call with value 1.
Step 2: Evaluate the first assignment
During the first execution of funcp(), the stored value is incremented before being returned.
Stored value after increment = 2
Hence, the variable x in main() receives the value 2.
Step 3: Evaluate the expression in the second assignment
The same stored variable inside funcp() is accessed again. Its current value is incremented once more and returned.
Returned value = 3
The expression being evaluated is:
3 + 2 = 5
So the variable y is assigned the value 5.
Step 4: Compute the printed result
The output statement prints the sum of the two variables in main():
2 + 5 = 7
Final Answer:
7
Let \(A\) be the adjacency matrix of the given graph with vertices \(\{1,2,3,4,5\}\). 
Let \(\lambda_1, \lambda_2, \lambda_3, \lambda_4, \lambda_5\) be the eigenvalues of \(A\) (not necessarily distinct). Find: \[ \lambda_1 + \lambda_2 + \lambda_3 + \lambda_4 + \lambda_5 \;=\; \_\_\_\_\_\_ . \]