Write a program to print the number in reverse | CODE WITH SHARAD

Write a program to print the number in reverse

Written by Sharad Raj on 13th of March, 2018

BASIC PROGRAMS   C LANGUAGE PROGRAMS

PROGRAM CODE

#include<stdio.h>

#include<conio.h>

void main()

{

int n,rev=0,rem;

clrscr();

printf("Enter the number : ");

scanf("%d",&n);

while(n>0)

{

rem=n%10;

rev=(rev*10)+rem;

n=n/10;

}

printf("\nReverse of the number is : %d",rev);

getch();

}


Comments


Contact