Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(void)
- {
- int x,y,z;
- printf("Please enter a natural number from 11 to 100000000\n");
- scanf("%d",&z);
- for(x=10;z>x;x=10*x){
- if(z/x<=10){
- y=z%x;
- y=y%100;
- y=y/10;
- printf("the second from last digit is %d",y);
- break;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment