- Determine if the following statements have any errors. If so, highlight them and explain why.
a. int 1st value=20;
b. Assume < x=0, y=0, zero=1;> zero =(x=1) && (y=0);
c. Assume < x=10, y=3, z=0;> y=++x+y; z=z−−>x;
d. CHAR c = ‘b’;
Basic C++ Question
int 1st value=20;
variable names cannot start with a number and cannot have spaces
Assume < x=0, y=0, zero=1;> zero =(x=1) && (y=0);
maybe u mean to use ‘==’ instead of = . = just assigns, == checks the value, if no then = will always return true, simply because it is able to assign it and how can an assigment be false?
Assume < x=10, y=3, z=0;> y=++x+y; z=z−−>x;
no mistake but z here is an int and takes a boolean value now, will be a warning
last has no mistake
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.