ladielynn6306 ladielynn6306
  • 18-01-2020
  • Computers and Technology
contestada

Assume that c is a char variable has been declared and already given a value. Write an expression whose value is true if and only if c is a newline character.

Respuesta :

ijeggs
ijeggs ijeggs
  • 18-01-2020

Answer:

(c == '\n')

Explanation:

The following code in C++ shows the use of this expression

#include <iostream>

using namespace std;

int main()

{

char c;

cout<<"Enter a character for c"<<endl;

cin>>c;

if (c == '\n'){

   cout<<"True"<<endl;

}

else

   cout<<"False"<<endl;

   return 0;

}

Answer Link

Otras preguntas

Where are most faults located? And what is a fault in science terms?
Where are most faults located? And what is a fault in science terms?
Where are most faults located? And what is a fault in science terms?
How do you do y divided by 9=12?
What is 32 over 48 simplified and with what numbers
one number is 6 more than another.  Their product is is 520.  Find the numbers
What is 32 over 48 simplified and with what numbers
a population decrease from 404 million to 288 million .which of the following is the percent decrease of the population
Where are most faults located? And what is a fault in science terms?
a population decrease from 404 million to 288 million .which of the following is the percent decrease of the population