# how to seperate a number into digits using c programming?

+1 vote
closed Jun 15, 2019
closed with the note: Closing question since already solved.

answered Jun 1, 2019 by Raghul K S A
#include<stdio.h>

int main()

{

int num;

scanf("%d",&num);

while(num>0)

{

num=num/10;

printf("%d",num);

}

}
answered Jun 2, 2019 by (220 points)
#include<stdio.h>

int main()

{

int a,rem;

scanf("%d",&a);

while(a!=0)

{

rem=a%10;

printf("%d ",rem);

a=a/10;

}

return 0;

}
answered Jun 2, 2019 by (140 points)
#include <stdio.h>

int main()

{

int num;

scanf("%d", &num);

while(num)

{

printf("%d ", num%10);

num /= 10;

}

return 0;

}
answered Jun 3, 2019 by anonymous
#include <stdio.h>

int main()

{

int n;

printf("Enter a Number You want to Separate in Digits: ");

scanf("%d",&n);

while (n>0)

{

n=n%10;

printf("The digit are %d",n,);

n=n/10;

}

return 0;

}
answered Jun 14, 2019 by (180 points)
#include<stdio.h>

int main(){

int num,rem;

printf("enter the number:");

scanf("%d",&num);

while(num!=0){

rem=num%10;

printf("%d\n",rem);

num=num/10;

}

return 0;

}