nkengafacnc nkengafacnc
  • 26-01-2020
  • Computers and Technology
contestada

How can I write an assignment statement that stores the character 'X' in a variable ch?

Respuesta :

l135134 l135134
  • 01-02-2020

Answer:

In C++ we can assign a character to the variable by using the below statement.

ch='X';

Explanation:

The complete program for assigning a character to the variable is given as

#include<iostream>

#include <conio.h>

using namespace std;

main()

{

char ch;

ch= 'X';

cout<<"output of variable Ch ="<<ch;

getch();

}

In above program Char is the data type used for character type variables. ch= 'X' stores X in ch. Then output will shown through cout.

Answer Link

Otras preguntas

Which of the number(s) below are potential roots of the function?p(x) = x4 + 22x2 – 16x – 12
What some players famous for biting others? Other than Luis Suarez :)
where are the largest gold deposits found?
If -nx2 + tx + c = 0, what is x equal to?
where are the largest gold deposits found?
1)simplify the expression (2x)^42)the perimeter of a rectangular is twice the sum of its length and its width. the perimeter is 16 meters and its length is 2 me
why oxygen important in your body?
How do you find the constant of variation when y=-(2/3) and x=3
I really need help on this one...ASAP!I will try to answer your questions if you answer this soon asap! PLZZZZ!!!What would a equal if 4(a+12) was 32?
A 1.0 kg book is lifted 0.5 m above the table , but the table is 1.0 m above the floor , what would be the P.E of the book if the reference level where the flo