Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- int num,temp,factor=1;
- printf("Enter a number: ");
- scanf("%d",&num);
- temp=num;
- while(temp){
- temp=temp/10;
- factor = factor*10;
- }
- printf("Each digits of given number are: \n");
- while(factor>1){
- factor = factor/10;
- printf("%d\n",num/factor);
- num = num % factor;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement