+ 3
We declared the variable as float and then gave integer value to it so why didn't that show any error..
Quetion: #include <iostream> Using namespace std; int main() { float a=10; if(a == 10) cout<<"YES"; return 0; } Output :- YES If any one have the link of the theory or concept of above question...then please send me..
3 odpowiedzi
+ 3
While assigning value to "a", 10 is internally converted to 10.0 ( which is a floating point number ). This process is known as implicit type conversion.
+ 3
Can you explain me in deeply ? Please what is about implicit type conversion .. for other data types
+ 1
Janvi Desai have a look at this 👇
https://www.geeksforgeeks.org/implicit-type-conversion-in-c-with-examples/