Computer Science, asked by dennishardik2673, 7 hours ago

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 krushnapache0157F
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