Answers for "method which takes in an integer and prints the last digit of the number java"

1

Find first and last digit of int

#include <iostream>
using namespace std;

int main()
{
    int number;
    cout << "Enter a number : " << endl;
    cin >> number;

    cout << "Last digit is : " << number % 10 << endl;

    while(number >= 10){
        number = number/10;
    }

    cout<< "First digit is : "<< number << endl;
    return 0;
}
Posted by: Guest on April-03-2022
0

how to find last digit in number by regex in java

(\d+)(?!.*\d)
Posted by: Guest on November-10-2020

Code answers related to "method which takes in an integer and prints the last digit of the number java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language