0

Where I am lacking

#include <iostream> using namespace std; int main() { int x; int y; int z=0; int a; cin>>x; {x%10=a; cout<<a;} {z=x-a;} {y=z/10; cout<<y;} return 0; }/*to print the ones and tens digit of a number entered by user can any tell where i am lacking*/

13th Mar 2019, 10:28 AM
Ahmad Raza
Ahmad Raza - avatar
2 Answers
+ 5
Replace x%10=a with a=x%10. You can't assign an uninitialized variable to an expression.
13th Mar 2019, 10:35 AM
Anna
Anna - avatar
0
thank
13th Mar 2019, 10:48 AM
Ahmad Raza
Ahmad Raza - avatar