How can I assign variable x of type int the value 3 from the char variable ch = '3'??.
char ch = '3';
int x;
// assign 3 to x using ch.
How can I assign variable x of type int the value 3 from the char variable ch = '3'??.
char ch = '3';
int x;
// assign 3 to x using ch.
x=ch-'0';
Use the above code you will get your desired answer!