C program to display the reverse of the given number

 Program code

#include <stdio.h>

#include <conio.h>

void main()

{

long int temp=0, number=0, reverse=0;

clrscr();

printf(“Please input a whole number to get its reverse.\n”);

scanf(“%ld”,&number);

for (temp=number;temp>0;temp=temp/10)

reverse=(reverse*10)+(temp%10);

printf(“The reverse of %ld is %ld\n”, number, reverse);

getch();

}


Example of output

Please input a whole number to get its reverse.

6754

The reverse of 6754 is 4576

Share:

1 comment:

  1. Luckyland Casino - JT Hub
    Luckyland Casino 밀양 출장샵 안양 출장샵 It's the latest casino in the 용인 출장샵 west 경상북도 출장샵 of Las Vegas to 파주 출장안마 offer a huge selection of games, generous bonuses, and high-quality games.

    ReplyDelete

Popular Posts

Contact Form

Name

Email *

Message *

Recent Posts

Copyright Matlab Project Codes All rights Reserved. Powered by Blogger.

Blog Archive