#include <stdio.h> int main() { int x; //input number int rev; //reverse will be stored in this variable printf("Type a number to get reverse of the number: "); scanf("%d", &x); printf("The number is: %d \n", x); while(x>0) { rev = rev*10 + x%10; x= x/10; } printf("Reverse of the number is: %d \n", rev); return 0; }
This blog is all about my experiments with Embedded Systems and Bluetooth, in general. There are a lot of blogs and articles which cover several aspects related to programming languages, devices, etc.. Not everything out there is easy to understand and this is my attempt to make it comprehensible. It’s more of an exact account of my work/projects/assignments. Enjoy!
Saturday, 18 November 2017
Programs on C - Reverse of a number
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment