- Back to Home »
- C , code , coding , number , program , project c++(basic) , reverse »
- coding for reversing a number and then printing it in c
Posted by : Unknown
Monday 22 December 2014
#include<stdio.h>
#include<conio.h>
void main(){
int a;
int b;
printf("Enter the number You want to reverse: ");
scanf("%d", &a);
printf("\nNumber you Entered is: ");
b = printf("%d", a);
printf("\nIts reverse is: ");
for (int i = 0; i < b; i++){
printf("%d", a%10);
a /= 10;
}
_getch();
}
#include<conio.h>
void main(){
int a;
int b;
printf("Enter the number You want to reverse: ");
scanf("%d", &a);
printf("\nNumber you Entered is: ");
b = printf("%d", a);
printf("\nIts reverse is: ");
for (int i = 0; i < b; i++){
printf("%d", a%10);
a /= 10;
}
_getch();
}