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();
}

OUTPUT 


Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to check age of any student is teen age or not.