daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Aug 12th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main ( )
  6. {
  7.     int y = 7632;
  8.     int x = 1;
  9.     cout << "Digit " << x << "of " << y << "is : ";
  10.     int dig;
  11.     dig = ((y - (y % (int)pow(10, x))) / (int)pow(10, x)) % (int)pow(10, x);
  12.     cout << dig << "\n";
  13.     return 0;
  14. }
  15.  
  16. // Digit 1of 7632is : 3
RAW Paste Data
Top