Guest User

Untitled

a guest
Aug 20th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int x,y,z;
  6. printf("Please enter a natural number from 11 to 100000000\n");
  7. scanf("%d",&z);
  8. for(x=10;z>x;x=10*x){
  9. if(z/x<=10){
  10. y=z%x;
  11. y=y%100;
  12. y=y/10;
  13. printf("the second from last digit is %d",y);
  14. break;}
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment