+ 1

How can compare float and integer in ?

4th Jul 2020, 1:23 AM
Sahan
Sahan - avatar
2 Answers
+ 3
Try this: #include<stdio.h> int main() { int num1=25; float num2=25.0; if(num1==num2) printf("num1 and num2 are equal"); else printf("num1 and num2 are not equal"); return 0; }
4th Jul 2020, 1:45 AM
James Clark I. Vinarao
James Clark I. Vinarao - avatar
+ 1
Just like you compare any other types. And please use the search bar or google it first. It is not hard to find the answer to this question. Have a good day, Ćheyat https://code.sololearn.com/cpi9a5M7t1EI/?ref=app
4th Jul 2020, 1:45 AM
Saphal Poudyal
Saphal Poudyal - avatar