+ 1
Give me examples of codes having variable Boolean,double and single and (!) symbol also plz put the outputs. language is c++
2 odpowiedzi
+ 2
#include <iostream>
using namespace std;
int main() {
double a = 10.6286;
bool b = false;
if (!(b)){
cout << a;
}
return 0;
}
Output :
10.6286
Here, this (!) is sign of not, which reverse any result, if it is true it will reverse to false or if result is false it will reverse to true.
That's what I did here.
if(!(b)){
cout << a;
}
Here, value of b is false and the not sign will make it true so it will print the value of a.
0
Thnx Raj