Find the errors in the following statements and re-write it making necessary corrections.
i. int a; b; c;
ii. int a, float b;
iii. int a=12.3;
iv. float a=12.69;
Hope you understand this question and answer this.
Answers
Answered by
2
Answer:
1.int a,b,c;
2.int a;
float b;
3.int a=12;
4.float a=12.69;
Answered by
6
The errors in the following statements are :
i. int a; b; c;
- In any datatype, more than one variable are separated by commas.
- Correct statement: int a, b, c;
ii. int a, float b;
- To write int and float datatype in code, we've to separate them by writing two different statements
- Correct statement: int a; float b;
iii. int a=12.3;
- In integer datatype, we've to assign value of variable as a integer.
- Correct statement: int a= 12;
iv. float a=12.69;
- Above statement is already correct
Similar questions
English,
4 months ago
English,
4 months ago
Geography,
4 months ago
Social Sciences,
1 year ago
Math,
1 year ago