IGNOU, SMU and KSOU Bsc solved assignments – C++ Program to reverse a digit

IGNOU, SMU and KSOU Bsc solved assignments – C++ Program to reverse a digit

If you are BSc IT, Btech C/S, MCA or Msc computer science or Bsc computer science students and looking for solved assignments on C++ here is proper solution.

Below Program to reverse a digit. It is solved assignment for IGNOU, SMU and KSOU Bsc IT or Computer science students and MCA students.

// Program to reverse a digit.

 

#include<iostream.h>

#include<conio.h>

 

void main()

{

clrscr();

 

long int dig,rem,rev=0;

 

cout<<” Enter a digit : “;

cin>>dig;

 

while(dig!=0)

{

rem=dig%10;

rev=rev*10+rem;

dig=dig/10;

}

 

cout<<endl<<” Digit after Reversing : “<<rev;

 

getch();

}

 

All New Updates

Leave a Reply

Your email address will not be published. Required fields are marked *

Security Code: