English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

it wont go into the functions and do the steps . I ran it i enter the number and it doesnt do ne thing HELP PLEASE! its C++

#include

void pos (int num);
void neg (int num);
void zero (int num);


int main(void)
{
int n;
int num;


cout << "Enter a number Negative, Positve, or Zero.";
cout << '\n';
cin >> num;

if (num > 0)
{
void pos(int num);
}
else if (num < 0)
{
void neg(int num);
}
else
{
void zero(int num);
}

cin >> n;

}

void pos(int num)
{

cout << "Your Number Is Postive ";
cout << num << " .";

}

void neg(int num)
{

cout << "Your Number Is Negative ";
cout << num << " .";

}

void zero(int num)
{
cout << "Yor Number Is ";
cout << num << " ,therefore it's neither Negative Nor Postive.";

}

2006-11-27 09:26:07 · 6 answers · asked by Anonymous in Computers & Internet Programming & Design

6 answers

your getting a little anxious in your coding:
try changing the section below:

cout << "Enter a number Negative, Positve, or Zero.";
cout << '\n';
cin >> num;

if (num > 0)
{
pos(num);
}
else if (num < 0)
{
neg(num);
}
else
{
zero(num);
}

2006-11-27 09:29:04 · answer #1 · answered by Anonymous · 2 0

I'm not completely sure here because I'm not a C++ programmer, but I don't think you need to include the access modifiers (i.e. void) when making a call to the functions.

if (num > 0)
{
void pos(int num);
}

should be

if (num > 0)
{
pos(int num);
}

2006-11-27 10:07:15 · answer #2 · answered by Jackson 2 · 0 1

your "function calls":
void pos(int num);
void neg(int num);
void zero(int num);

are not calling the functions. They are simply declaring it again.

change them to
pos(num);
neg(num);
zero(num);

2006-11-27 09:31:37 · answer #3 · answered by clueless_nerd 5 · 0 0

You are making the calls to your pos(), neg(), and zero() functions incorrectly.

When you state:

void func(int arg);

You are telling the compiler that you are declaring a function called func that returns a void and takes an integer as an argument.

However, when you call it you need to use the syntax:

func(arg);

rather than:

void func(int arg);

2006-11-27 09:31:32 · answer #4 · answered by Anonymous · 2 0

some thing is incorrect if it infringes on a individual's organic rights. easily each physique are entitled to issues which includes life, liberty, and prosperity. So in case you kill a individual, you get rid of their life. in case you positioned them by way of dominance and abuse without their consent, you get rid of their liberty. in case you scouse borrow their assets or money, you're affecting their prosperity. some thing is solid if it preserves those organic rights and promotes them for others. in case you retain somebody, artwork to supply human beings suffrage, or provide to charity, you're doing the terrific factor. even although, the line between proper and incorrect frequently will become blurred. case in point, think you kill a murderer who broke into your place to maintain your guy or woman relatives. in this occasion, we are able to dissect your strikes and choose them for my section to be the two proper or incorrect. Killing the guy replaced into incorrect, yet retaining your loved ones and assets replaced into proper. consequently, the style of proper strikes and the quantity of solid that replaced into performed is larger than the evil, so which you would be proper in this concern.

2016-12-13 15:20:05 · answer #5 · answered by jowers 4 · 0 0

what it that

2006-11-27 09:28:03 · answer #6 · answered by Patrick L 2 · 0 4

fedest.com, questions and answers