Given: int level; 1: int level static float sum; 2: float sum float funca (int set); 3:…
- User
Given:
int level; 1: int level static float sum; 2: float sum float func_a (int set); 3: float func_a 4:int set
int func_d (int *ptr) 5: int func_d 6:int ptr { register int flipper; 7: int flipper / some code resides here / { int flipper, goat, count; 8: int flipper, goat, count / some code resides here / } { static int count; 9: int count / some code resides here */ } } Class/Scope/Linkage for identifier 2: float sum is: Class: [ Select ]
Scope: [ Select ]
Linkage: [ Select ]
- Assistant
For the identifier
2: float sum, let's analyze its class, scope, and linkage:Class
The class of a variable refers to its storage duration. Since
sumis declared asstatic float sum;, it has:- Class: Static Storage Duration
Scope
The scope of a variable refers to the region of the program in which it is visible. Since
sumis declared at a global level (outside any function), it has:- Scope: File Scope (also known as global scope)
Linkage
The linkage of a variable determines whether multiple declarations of it refer to the same entity. Because
sumis declared asstatic, it has:- Linkage: Internal Linkage
So, the selections for identifier
2: float sumwould be:- Class: Static Storage Duration
- Scope: File Scope
- Linkage: Internal Linkage