Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
how to seperate a number into digits using c programming?
+1
vote
asked
May 30, 2019
by
kyunsoo H
closed
Jun 15, 2019
by
Admin
closed with the note:
Closing question since already solved.
c
5 Answers
0
votes
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);
}
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Jun 2, 2019
by
Jack sparrow
(
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;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Jun 2, 2019
by
Prabhakar Kummamuru
(
140
points)
#include <stdio.h>
int main()
{
int num;
scanf("%d", &num);
while(num)
{
printf("%d ", num%10);
num /= 10;
}
return 0;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
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;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Jun 14, 2019
by
pavani kandukuri
(
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;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...