Sunday, 21 January 2018

Program for Reverse the Number


Program for Reverse the Number
#include<stdio.h>
#include<conio.h>
main()
{
int a,r,rev=0;
clrscr();
printf("enter the value of a");
scanf("%d",&a);
while(a!=0)
{
r=a%10;
rev=rev*10+r;

a=a/10;
}
printf("The reverse no of the given no is=%d",rev);
getch();

}

Related Posts:

  • Introduction To ARRAYS Introduction To ARRAYS  An array is a group of related data items that share a common name.For instance,  we can define an array name Salary to represent a set of salaries of a group of employees. A particular … Read More
  • Initialization of Arrays Initialization of Arrays We can initialize the elements of the array in the same way as the ordinary variables when they are declared.The general form of initialization of array is:  static  type  array-… Read More
  • Two-Dimentional Arrays Two-Dimentional Arrays So far we have discussed the array variable that can store a list of values .There will be situation where a table of values will have to be stored.Consider the following data table, which shows t… Read More
  • Declaration of Arrays Declaration of Arrays  Like any other variables, arrays must be declared before they are used.The general form of array declaration is type variable-name [size]; The type specifies the type of elements that will be… Read More
  • Pointers And Structures Pointers And Structures  We know that the name of an array stands for the address of its zeroth element.The same thing is true of the names of  arrays of structure variables.Suppose product is an array variabl… Read More

0 comments:

Post a Comment