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

Problem 5: Hero's Formula is A method for calculating the area of a triangle when you know the lengths of all three sides. Let a, b, c be the lengths of the sides of a triangle. The area is given by:A= pp-ap-b(p-c) | wherep= a+b+c2 | | Write a C-language code to calculate area of triangle using above method. Take the three lengths of the triangle from the user and display the area that your program calculates.

0 Answers   Maxobiz,


write a program in c++ to generate imp z y x w v w x y z z y x w x y z z y x y z z y z z

4 Answers  


Explain the concept of memory leak?

0 Answers  


Why was c++ made?

0 Answers  


What is a sequence in c++?

0 Answers  






Why is c++ considered difficult?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. x + y=z;

2 Answers  


What do you understand by a pure virtual member function?

0 Answers  


Write the program for fibonacci in c++?

20 Answers   TATA, Wipro,


What are advantages of c++?

0 Answers  


What is ios flag in c++?

0 Answers  


What is istream c++?

0 Answers  


Categories