Write a program to receive a five-digit no and display as like 24689:
2
4
6
8
9
Program in C Language
#include<stdio.h>
#include<conio.h>
#include <math.h>
void main()
{
int num,i;
printf ("Input a five digit number: ");
scanf ("%d", &num);
for (i = 4; num > 0; i--)
{
printf ("%d", num / (int)pow (10, i));
num = num % (int) pow (10, i);
printf ("\n");
}
getch();
}
No comments:
Post a Comment