why do we need && operator for a do-while loop when a || operator is the logical choice?
eg-
char ch {' '};
do{
cout<<"ENTER something :";
cin>>ch;
} while ((ch!= 'q') && (ch!='Q'));
Answers
Answered by
1
Answer:
#include <iostream>
using namespace std;
int main()
{
int n = 4, k = 2;
cout << ++n << endl;
cout << n << endl;
cout << n++ << endl;
cout << n << endl;
cout << -n << endl;
cout << n << endl;
cout << --n << endl;
cout << n << endl;
cout << n-- << endl;
cout << n << endl;
cout << n + k << endl;
cout << n << endl;
cout << k << endl;
cout << n << k << endl;
cout << n << endl;
cout << " " << n << endl;
cout << " n" << endl;
cout << "\n" << endl;
cout << " n * n = "; //CAREFUL!
cout << n * n << endl;
cout << 'n' << endl;
return 0;
Explanation:
Similar questions
Business Studies,
4 hours ago
Chemistry,
4 hours ago
CBSE BOARD X,
7 hours ago
Biology,
8 months ago
Math,
8 months ago
Chemistry,
8 months ago