+ 5
Why am i getting this error?
12 Antworten
+ 5
The error in this code is that the variable b is declared inside the if statement, but it is used outside of it. The variable b should be declared outside of the if statement.
+ 5
b does not have value assigned to.
What input do you expect? what output do you expect?
+ 3
Did you read when you get some error, what output in console???
error: variable might not have been Intialized.
Learn read first.
+ 2
I think you need to initialize the int b
So replace int s,b; with int a,b = 0;
0
Suvan Shenoy
Is this an inappropriate way to write?
but there is no syntax error..
- 1
Smith Welder
Ya i read, it was written that b has not been initiatized but i was confused, that i have given tha value of b in if-else so why it's giving the not initialzed error
- 1
Lisa i was trying to find hcf of two numbers
- 1
Thank you all for helping me✌️
- 1
did u correct your mistake?
- 1
miguel🦋 yes