What Is The Prop

what is the prplem hete

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream.h>
void main ()
{
  int x,y;
int sum;
cout<<"enter 1st number";
cin>>x;
cout<<"enter 2st number";
cin>>y;
sum=x+y;
// print out a message what the level

if (sum > 80 ) {
cout<<"high"<< endl;
}

else {
if (sum > 60 ) {
cout <<"Mid"<< endl;
}

else {
cout<<"low"<< endl;

 system ("pause");
return 0;

 }
}


3 errors plz check it for me
You don't tell the program that you are using anything from the std namespace (cin, cout and endl).

You also have a return value in a function that returns nothing (main should be of return type int, not void).

Also, 2st should be 2nd (second).

I won't get into system (), but I'll plant the seed so that you can look around the site trying to figure it out.
Last edited on
You lack a }. I'm sure it's written in the error message.
By the way, it's proBlem.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
int main (void)
{
  int x,y,z;
int sum;
cout<<"enter 1st number";
cin>>x;
cout<<"enter 2nd number";
cin>>y;
cout<<"enter 3d number";
cin>>z;
sum=x+y+z;
// print out a message what the level

if (sum > 80 ) {
cout<<"high"<< endl;
}

else {
if (sum > 60 ) {
cout <<"Mid"<< endl;
}

else {
cout<<"low"<< endl;

return 0;

 }
}
}



i fix it & its open okay

but i wanna an add ... to puse when finsh

cuz the programme close auto

and i think system ("pause");


for pause .... please edit my last code ... i want it puse when finish
By the way, it's proBlem.


And here.

please edit my last code


No. There is a topic PINNED to the beginners board DEDICATED to the issue of keeping the console open. I suggest you just run it directly through the console (run cmd, navigate to the directory where the file is stored, run it).

How does that run without any mention of std?
Last edited on
get me the command of pause and i will be happy from you
Topic archived. No new replies allowed.