The source code to demonstrate the logical NOT (!) operator is given below. The given program is compiled and executed successfully.
// Rust program to demonstrate
// the logical NOT "!" operator
fn main() {
let mut num1:i32=22;
let mut num2:i32=22;
if !(num1==num2)
{
println!("includehelp");
}
else
{
println!("www.includehelp.com");
}
}
Output:
www.includehelp.com
Explanation:
Here, we created two integer variables num1, num2, that are initialized with 22, 22 respectively. Then we compared variables and performed a logical OR (||) operation to compare numbers and printed the appropriate message.
Program/Source Code:
The source code to demonstrate the logical NOT (!) operator is given below. The given program is compiled and executed successfully.
Output:
Explanation:
Here, we created two integer variables num1, num2, that are initialized with 22, 22 respectively. Then we compared variables and performed a logical OR (||) operation to compare numbers and printed the appropriate message.
need an explanation for this answer? contact us directly to get an explanation for this answer