Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to check a condition is true or false in the program

C#
if (m=(f1 + 1)-(k - 1))


But while writing the code it is showing some error saying cannot convert from int to bool


How can I solve this problem???


Thanks
John
Posted

1 solution

Try changing your operator to double equals.

Single equal is used for assigning, double for comparison.

C#
if (m==(f1 + 1)-(k - 1))


... hope it helps.
 
Share this answer
 
Comments
thatraja 6-Jan-14 10:28am    
5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900