The program below separates the digits of a five-digit number using C programming language.

Question: Write a program that inputs one five-digit number, separates the number into its individual digits and prints the digits separated from one another by three spaces each. [Hint: Use combinations of integer division and the remainder operation.] For example, if the user types in 42139, the program should print 4 2 1 3 9

C program to separate the digits in a Number
Sample program run
 

1 Comment

Write A Comment