Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

PROGRAM USNG WHILE LOOP TO REVERSE THE DIGITS OF THE NUMBER NO IS - 12345 ANSWER IS 54321

Posted By: Clark Butler     Category: C Programming     Views: 22141

WRITE A PROGRAM USNG WHILE LOOP TO REVERSE THE DIGITS OF THE NUMBER.
NO IS - 12345
ANS IS 54321

Code for PROGRAM USNG WHILE LOOP TO REVERSE THE DIGITS OF THE NUMBER NO IS - 12345 ANSWER IS 54321 in C Programming

#include <stdio.h>
#include <conio.h>
#include<math.h>


void main()
{
long n,j;
clrscr();
printf("Enter the No :- ");
scanf("%ld",&n);
       printf("\n");
       printf("Reverce of the number is....");
    while(n>0)
    {
       j = n%10;
       printf("%ld",j);
      n /= 10;
    }

getch();

}

/*
********
OUTPUT
********

Enter the No :- 23456

Reverce of the number is....65432
*/
  
Share: 



Clark Butler
Clark Butler author of PROGRAM USNG WHILE LOOP TO REVERSE THE DIGITS OF THE NUMBER NO IS - 12345 ANSWER IS 54321 is from New York, United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!