Turn Desktop View Off
by Dinesh Thakur Category: C Programming (Pratical)

In this program user ask to reverse the Entered number. User declares the required variables for storing the value. User asks to enter the number. User declares the loop statement for reversing the number. Here user also declares the swapping method for this convention like b=a%10, c=a/10, a=c. printing out the condition on display as result on the mark.

Problem Statement:

This is C program that asks user to reverse the entered Number.

  1. Declaring the variables.
  2. Using loop statement.
  3. Display result on the screen.

Here is C source code for reversing the 10 digit number. Output of this program shown below. 

#include<stdio.h>
#include<conio.h>
void main()
{
          long int a;
          int b,c,i;
          clrscr();
          printf("This will Reverse the Entered number : \n");
          printf("Please Enter the Five Digit Number : \t");
          scanf("%ld",&a);
          for(i=1;i<=5;i++)
              {
                     b=a%10;
                     c=a/10;
                     a=c;
                     printf("%d ",b);
              }
                     getch();

Reverse the Entered Number



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.