-2

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.

1 Answers1

-2

x=ch-'0';

Use the above code you will get your desired answer!