Program to input two digit number and print their Reverse.
In this program input two digit number and print the sum of its digits. For this we find 1st digit by number/10 and 2nd digit by n%10 . In the end we multiply 2nd number to 10 and add 1st number.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,d1,d2,r=0;
clrscr();
printf("Enter two digit number=");
scanf("%d",&n);
d1=n/10;
d2=n%10;
r=(d2*10)+d1;
printf("\nReverse of number=%d",r);
getch();
}

Comments
Post a Comment