1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
IgorC [24]
4 years ago
6

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

Computers and Technology
1 answer:
Gre4nikov [31]4 years ago
5 0

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.

You might be interested in
What does obsolete mean?
Alex
No longer produced or used; out of date.
8 0
3 years ago
Read 2 more answers
Compare userNumber with compareNumber and display 'Numbers are not equal' if the numbers are different. Then, display 'Variables
masya89 [10]

Answer:

Following are attached images that will help you understand the complete code. The code is tested with different variables and different outputs are obtained. All the necessary description is given in the form o comments inside the code.

Explanation:

3 0
3 years ago
) Which of these will not select all the cells in a document?
dolphi86 [110]
Pressing enter two times I’m pretty sure that’s right cuz like it does nothing when I do it. It’s either that or idk up to u to take an answer from someone who has bad grammar
4 0
3 years ago
What is the number system that uses only the numbers 0 and 1?
Bingel [31]
It is c because its C
4 0
3 years ago
For this portion of the lab you will design the solution so that you perform some conditional tests. For this lab: 1. You will v
PIT_PIT [208]

Answer:

#Prompt the user to enter the miles.

Miles = float(input('Enter the miles to convert into kilometer: '))

#Check the miles.

if Miles >= 0 :

   #Convert the miles to kilometers.

   Miles_To_km = Miles*1.6

   #Display the result.

   print (Miles, "miles equivalent to", Miles_To_km, "kilometer.")

   #Prompt the user to enter the gallons.

   Gallon = float(input('Enter the gallons to convert into liter: '))

   #Check the validity of the Gallons entered.

   if Gallon >= 0:

       #Convert gallons into liters.

       Gal_To_Lit = Gallon*3.9

       #Display the result.

       print (Gallon, "gallons equivalent to", Gal_To_Lit, "liters.")

       #Prompt the user to enter the pounds.

       Pound = float(input('Enter the pounds to convert into kilograms: '))

       #Check the validity of the Pounds entered.

       if Pound >= 0:

           #Convert pounds into kilograms.

           Pounds_To_Kg = Pound*0.45

           #Display the result.

           print (Pound, "pounds equivalent to", Pounds_To_Kg, "kilograms.")

           #Prompt the user to enter the temperature in Fahrenheit.

           f = float(input('Enter the temperature in Fahrenheit: '))

           #Check the value to be not greater than 1000.

           if f < 1000:

               #Convert Fahrenheit into celsius.

               F_To_C = (f -32)*5/9

               #Display the result.

               print (f, "Fahrenheit equivalent to", F_To_C, "celsius.")

           #Otherwise.

           else:

               

               #Display the error message.

               print ("Invalid temperature (greater than 1000) !!!")

       else:

           #Display the error message.

           print ("Pounds cannot be negative !!!")

   else:

           #Display the error message.

           print ("Gallons cannot be negative !!!")

else:

   #Display the error message.

   print ("Miles cannot be negative !!!")

Explanation:

4 0
4 years ago
Other questions:
  • This is going to get taken down but I dont care add me on discord cause ima bored<br> -Red-#9847
    12·1 answer
  • What is needed to create a good problem statement?
    10·1 answer
  • You want to drive traffic to a new landing page for a campaign, and want a web address that's short, easy to remember, trackable
    7·1 answer
  • Why would a designer choose to use an isometric sketch rather than a perspective sketch to share their idea with a design team m
    14·1 answer
  • A properYour customer has connected a 1000-watt microwave oven and a 600-watt mixer to a 15-amp branch service line for the kitc
    11·2 answers
  • 2. Because technology is always changing, there are new applications being developed constantly. (1 point)
    9·2 answers
  • When working with arrays, most programming languages perform ________, which means they do not allow programs to use invalid sub
    5·1 answer
  • Part of the central processing unit
    14·1 answer
  • como la ciencia y tecnologia ayudan a reducir la contaminacion del aire que respiramos? Muestra algunos ejemplos
    12·1 answer
  • Another name of computer program is
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!