+ 2
Why campiler give error
9 odpowiedzi
+ 5
Arash , there are 2 warnings when running the code:
int a;
char b;
int c;
double d = c*a/100; // <-------
cin>>a>>b>>c;
both are from the line which is marked. You are using 2 variables "a" and "c" that are both NOT initialized with a value, since cin is used in the next line. This can cause problems. swap this 2 lines to run the code.
+ 4
everything works fine, you just have to give input like this:
2
*
4
instead of
2*4
+ 4
If you input an unrecognised operator, the code output will be 'error'.
+ 3
It's not error but a warning. You have defined variable `d` but haven't used it anywhere in code.
Either remove line 8 or comment it down like this:
//double d;
+ 3
Arash
Remove this line:
double d = c*a/100;
Change this line:
cout<<a<<"%"<<c<<"="<<d;
To:
cout<<a<<"%"<<c<<"="a%c;
Finish the C++ lesson and use google or bing or read the C++ documentation.
+ 2
Arash , again.. a warning not an error. You are using variables in an expression before assigning a value to them. First take input for variables and then calculate.
+ 1
Just remove line 8 and give input 2*3
+ 1
I used it in my code but its show error again
+ 1
I changed my code and now my problem is double again its not work like decimal number