Our Blog Contain Detail about Some Technical Aspect like Programming, Blogger, Tools and Tip, Suggestion, Motivational, Health, Program in C and Java, Html

Write a program to display digit of a five-digit no

 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();

}

Share:

No comments:

Post a Comment

Translate

Followers

Email Subscription

Enter your email address:

Delivered by FeedBurner

Recent Posts

Theme Support

Need our help to upload or customize this blogger template? Contact me with details about the theme customization you need.