answersLogoWhite

0

Write a program to split 4 digit?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

int n,r,rev=0;

clrscr();

printf("Enter a four digit number:");

scanf("%d",&n);

while(n>0)

{

r=n%10;

rev=rev*10+r;

n=n/10;

}

printf("Reversed format of the number is %d",rev);

printf("Now the digits are splitted\n");

while(rev>0)

{

r=rev%10;

printf("%d\t",r);

rev=rev/10;

}

getch();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to split 4 digit?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to write a java program to extract the last digit from the input?

Assuming you've entered a multi-digit number whole number (an integer), then take the modus (%) of the number and 10. E.g., if the number input was 1234, then 1234 % 10 is 4. Thus the final digit is 4. Note that modus 10 is the same as dividing the number by 10 and taking the remainder.


What is the greatest 4-digit number you can write?

9999


Write the largest 4 digit twice?

9999 9999


What is next to number series 15 225 3325 44325 5?

next number to this series is 554325. its look like this 15--add 1 to first digit and we get 2 and repeat two times and leave other digit.225 225-- its first digit is 2 and add 1 to it get 3 and write two time and write remaining digit as 3325. 3325-- its first digit is 3 and add 1 to it get 4 and write two time and write remaining digit as 44325. 44325-- its first digit is 4 and add 1 to it get 3 and write two time and write remaining digit as 554325.


What does write the place and the value of the underlined digit mean?

Write the place and the value of the underlined digit. 95463 The 4 is in the hundreds place and has a value of 400.


Write a 6 digit nimeral with 4 in the hundredths place?

123456.74


How do you write a 4 digit number with a 0 in hundred place and a 0 in the tens place then use the same four digit and tell which number is larger?

how do you write 4 digit numbers with a 0 in ten and hundred place then use the same number to tell which number is larger


Write the value of the underlined digit in short word form 93204240224 the underlined digit is 0?

4 million


Write the greatest 4 digit number possible using 2 5 9 and 4?

9542


Explain how to write a decimal that is less than 5 ten-thousandths?

Write a zero Write a decimal point Write a zero Write a zero Write a zero Write any digit less than 5 (if you wrote a zero you will have to write another digit or as many zeros as you want, and then a digit that is not a zero).


How do you write the least and the greatest 4 digit number that has a 4 in the hundreds place?

the greatest is 9499 and lowest 1400


How many different 3 digit numbers can you write with the digits 0 2 4 6 - using a digit only once in a number?

18