Solution Code:-
=========
#include <stdio.h>
int main(void)
{
int num;
printf("Enter a 5 digit +ve number : ");
scanf("%d",&num);
if (( num < 99999 ) && (num > 0 ))
{
printf("The number you entered is %d ",num);
printf("\nAlternate number is %d",num%10);
printf(" %d",((num/10) % 10));
printf(" %d",(((num/10) / 10) % 10));
printf(" %d",((((num/10) / 10) / 10) % 10));
printf(" %d",( num / 10000));
}
else
printf("Pl.enter valid +ve 5 digit number...");
return 0;
}
No comments:
Post a Comment