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
Sergio [31]
3 years ago
10

Write a program that prompts the user to input a number. The program should then output the number and a message saying whether

the number is positive, negative, or zero.
Computers and Technology
1 answer:
Gala2k [10]3 years ago
7 0

Answer:

Following is the program in C++ Language

#include <iostream> // header file

using namespace std; // namespace std

int main() // main method

{

   int n;  // variable declaration

   cout<<" Please enter the number :";

   cin>>n; // Read the number

   if(n>0) // check the condition when number is positive

   {

cout<<n<<endl<<"The number is Positive"; // Display number

   }

  else if(n<0) // check the condition when number is Negative

  {

cout<<n<<endl<<"The number is Negative";// Display number

  }

  else // check the condition when number is Zero

  {

cout<<n<<endl<<"The number is Zero";// Display number

  }

   return 0;

  }

Output:

Please enter the number:

64

The number is Positive

Explanation:

Following are the description of the program

  • Declared a variable "n" of int type.
  • Read the value of "n" by user.
  • Check the condition of positive number by using if block statement .If n>0 it print the number is positive.
  • Check the condition of negative number by using else if block statement If n<0 it print the number is negative.
  • Finally if both the above condition is fail it print the message " The number is Zero"

You might be interested in
Explain why there are fundamental ideas of software engineering that apply to all types of software systems.
olasank [31]

Solution:

Because of all software systems have common quality attributes, including  

Fundamental software engineering activities.  The four basic process activities of specification, development, validation and evolution are organized differently in different development processes.  The software is implemented either by developing a program or programs or by configuring an application system. Such that at they (Software engineer) have been made keeping in mind project development. They hence, apply to all software systems and even non software systems. They are the fundamentals for any kind of project development.

Thus this is the required answer..


5 0
3 years ago
If I make a Zoom Meeting, would you join it?
boyakko [2]

Most likely, yeah lol.

3 0
3 years ago
Read 2 more answers
"Unicorn designs Inc., a software company, requires its employees to wear a specific color every day of the week. The colors for
marishachu [46]

Answer:

Organizational culture

Explanation:

Organizational culture is a system of shared assumptions, values, and beliefs, which governs how people behave in organizations. These shared values have a strong influence on the people in the organization and dictate how they dress, act, and perform their jobs.

8 0
3 years ago
Read 2 more answers
Google Ads was constructed around three core principles, focused on helping businesses reach their online potential. The first o
PolarNik [594]

Answer:

True

Explanation:

Google Ads was constructed around three core principles, focused on helping businesses reach their online potential. The first of these is relevance. Google Ads connects businesses with the right people at the right time. The other principle is control and results.

7 0
3 years ago
In this exercise, you will write a class that represents how you spend your time during the week The class should have four doub
Nuetrik [128]

Answer:

Answered below

Explanation:

# Program is written in Java

class WeekHours{

double school;

double fun;

double sleep;

double sports;

WeekHours( ){

school = 0.0;

fun = 0.0;

sleep = 0.0;

sports = 0.0;

}

public void setSchool ( double x){

school = x;

}

public void setFun( double y){

fun = y;

}

public void setSleep( double w){

sleep = w;

}

public void setSports( double z){

sports = z;

}

public void totalHours(){

double tHours = school + fun + sleep + sports;

System.out.print(tHours);

}

}

4 0
3 years ago
Other questions:
  • Which of the following should you always wear to avoid being thrown from a vehicle and then crushed if it tips over?
    12·2 answers
  • Write a while statement that prints all even numbers between 1 and 100 to the screen.
    6·1 answer
  • Why do contour lines never cross?
    5·1 answer
  • "The network layer is responsible for transferring packets of data from the A.Source computer to the destination computer on adj
    11·1 answer
  • The Status bar is used to control the majority of the drafting settings in AutoCAD
    13·1 answer
  • How can you have a safe browser experience
    9·1 answer
  • Find the reciprocal of 7/2 × 3/5<br>​
    6·1 answer
  • Caleb is a big fan of science fiction, so he loves picturing the ________ gland as the captain of his personal starship, pulling
    9·1 answer
  • George wants to pursue a career in web technology as a web developer. Which certifications can help him as a web developer?
    5·1 answer
  • 30 Points!!
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!