Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Finding the first digit of a number
//g++ 5.4.0 #include <iostream> using namespace std; int main() { int x; int res = 0; cin >> x; while(x > 0) { res = x % 10; // finding the first digit of a number x /= 10; } cout << res; }
run
|
edit
|
history
|
help
2
HeapSort
Fractional Knapsack
2222aaaa
samp error
Get all anagrams from given words
staticfun
Classes Pt 2 c++
11340 v3.0
Coin changes
HeapSort