+ 1
I need to write function chiffre(int nombre,int place)
Hello World! /////////// write the function chiffre(int nombre ,int place) That returns the digit that is in the specified place /////////// How I can delete numbers on the left, for exemple in 123 To become 3 As we know, the numbers on the right can be deleted by dividing by 10. /////////// Thanks.
3 Antworten
+ 4
you can use the modulus to do that,
123%10=> 3
+ 2
num = num%10;
+ 1
Thanks bro