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



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

Answer / 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

More C++ General Interview Questions

Why is it difficult to store linked list in an array?

6 Answers   Infosys, Lucent,


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

0 Answers  


If I is an integer variable, which is faster ++i or i++?

0 Answers  


What is a protocol class?

1 Answers  


Can you Mention some Application of C/C++?

0 Answers  


What is the v-ptr?

0 Answers  


Define stacks. Provide an example where they are useful.

0 Answers  


describe private access specifiers?

0 Answers  


What is a .lib file in c++?

0 Answers  


Describe delete operator?

0 Answers  


What are register variables?

0 Answers  


How can you quickly find the number of elements stored in a dynamic array?

0 Answers  


Categories