Solved Examples · Example 7
Q.The textbook illustrates assignment within an executable part, which does not include the data type:
x = 10;
sum = 300.00;
name = "Ganapathi";
ch = 'y';
x = 10;
sum = 300.00;
name = "Ganapathi";
ch = 'y';
Karnataka PUCTextbookShort· 2mImportance★★★★★est
22% · 34/154 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →[!TLDR]
Assignment in the executable part uses the = operator to place a value into a variable that has already been declared; the data type is not written again.
The assignment operator = copies the value on its right into the variable on its left. So x = 10; stores the integer 10 in x, sum = 300.00; stores the real value 300.00 in sum, and ch = 'y'; stores the character 'y' in ch. Unlike initialization, these statements appear in the executable part and do not restate the data type, because the variables were declared earlier. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.