Friday, 20 May 2022

Learn to Reverse a Number in C

How to Reverse a Number C

Code to get the reverse number Code

#include<stdio.h>  
 int main()    
{    
int num, reverse=0, rem;    
printf("Enter a num");    
  scanf("%d", &num);    
  while(num!=0)    
  {    
     rem=num%10;    
     reverse=reverse*10+rem;    
     num/=10;    
  }    
  printf("Reversed Number: %d",reverse);    
return 0;  
}




OUTPUT WILL BE:




DBMS NOTES UNIT 3

                                                              UNIT 3  ER (Entity Relationship) An entity-relationship model is known as an E...