Search
 
SCRIPT & CODE EXAMPLE
 

C

Reverse integer in c

#include <stdio.h>

int main() {

  int n, reverse = 0, remainder;

  printf("Enter an integer: ");
  scanf("%d", &n);

  while (n != 0) {
    remainder = n % 10;
    reverse = reverse * 10 + remainder;
    n /= 10;
  }

  printf("Reversed number = %d", reverse);

  return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: letter in alphabet or not 
C :: wordpress clean name spaces 
C :: online embedded c compiler 
C :: function pointer in c 
C :: array in c 
C :: c check if file was created 
C :: c arrays 
C :: difference between int main() and int main(void) 
C :: strncmp 
C :: c program for determining a character is alphabet or not 
C :: mongodb delete all documents 
Dart :: dart random number 
Dart :: elevated button size flutter 
Dart :: how to change input text color in flutter 
Dart :: flutter random pick in list 
Dart :: flutter replace character in string 
Dart :: two dots dart 
Dart :: flutter get device width 
Dart :: print variable types in flutter 
Dart :: how to change legend colour in SfCircularChart in flutter 
Dart :: android application ic_launcher dimmensions 
Dart :: leading image flutter 
Dart :: flutter display widget based on device orientation 
Dart :: flutter icon tap 
Dart :: flutter audio player get duration 
Dart :: how to create timer in flutter 
Dart :: mainAxisAlignment vs crossAxisAlignment flutter 
Dart :: error: xmlhttprequest error. dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 906:28 
Dart :: Bad state: Stream has already been listened to 
Dart :: loop over list dart 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =