Advertisement

Input as=12345, Output’ll be=54321


#include<conio.h>
#include<stdio.h>
#include<math.h>
void main()
{      clrscr();
       int a,b;
       printf("Enter number=");
       scanf("%d",&a);
       while(a>=10)
       {  b=a%10;
                  a=a/10;
                  printf("%d",b);
                                 }
                    printf("%d",a);
                                      getch();
                                       }

No comments:

Post a Comment

Please comment bellow. Share your knowledge