A program to input a 2 digit integer and display its reverse in C

#include<stdio.h>
#include<conio.h>
main()
{
int n, D, R, S;
printf(“enter two digit number:”);
scanf(“%d”,&n);
D=n/10;
R=n%10;
S=R*10+D;
printf(“reverse number is:%d\n”,S);
getch();
}

Output:

A program to input a 2 digit integer and display its reverse in C

Leave a Reply

Your email address will not be published. Required fields are marked *