+ 1

Why do we write 'float salary' instead of 'float'

8th Jan 2020, 7:45 AM
Thisari Kanchana
Thisari Kanchana - avatar
2 odpowiedzi
+ 8
Thisari Kanchana float is only data type for using any variable like salary you need to attach that data type with variables name like float salary; Please revise the lesson again.
8th Jan 2020, 8:07 AM
GAWEN STEASY
GAWEN STEASY - avatar
+ 2
"float" is the data type, while "salary" is the name of the variable, together they form a declaration. The same with `int x;` for example; where "int" is the data type, and "x" is the variable name.
8th Jan 2020, 8:07 AM
Ipang