Program Code:
#include<stdio.h>int main()
{
int number ,a[5] ,i , temp , j;
printf("Enter any 5 digit number : ");
scanf("%d",&number);
for(i =0;i<5;i++)
{
temp = number % 10;
a[i] = temp ;
number = number / 10 ;
}
printf("Digits are : %d , %d , %d , %d , %d \n" ,a[4] ,a[3] ,a[2],a[1],a[0]);
return 0;
}
Output:
.exe file |
No comments:
Post a Comment