Reverse Of 5 Digit Number In C Program Tamil


#include<stdio.h>
#include<conio.h>
void main()
{
	int n,num,a,b;
	long int revnum=0;
	clrscr();
	printf("\n Enter The 5 digit Number :");// 32767    12345 54321
	scanf("%d",&n);		//www.tutorjoes.com
	num=n;
	a=n%10; //last digit
	n=n/10; //remaining digits
	revnum=revnum+a*10000;
	a=n%10; //4th digit
	n=n/10;	//remaining digits
	revnum=revnum+a*1000;		//www.tutorjoes.com
	a=n%10;	//3rd digit
	n=n/10;	//remaining digits
	revnum=revnum+a*100;
	a=n%10;	//2nd digits
	n=n/10;	//remaining digit
	revnum=revnum+a*10;
	a=n%10;	//1st digit			//www.tutorjoes.com
	revnum=revnum+a;

	if(revnum==num)
		printf("\n Reversed Number is Equal To the original Number..");
	else						//www.tutorjoes.com
		printf("\n Revrsed Number is Not equal to the original Number..");
	getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming