Write a C++ program to sort digits of all the 4 digit number
and display the sorted 4 digit number

Answer Posted / prasadnvk

i=0
while(num>0)
{
digit=num%10;
digitarr[i++]=digit;
num=num/10;

}
then sort the digitarr

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between strcpy() and strncpy()?

610


What is guard code in c++?

638


What is set in c++?

657


How do I run c++?

572


Is c++ double?

559






What are the unique features of C++.

570


What are the benefits of c++?

567


what is a class? Explain with an example.

617


Can a constructor be private?

577


Define token in c++.

712


What are the differences between malloc() and calloc()?

612


How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?

618


What do you mean by storage classes?

790


Is c++ harder than java?

566


Why is it necessary to use a reference in the argument to the copy constructor?

629