answersLogoWhite

0


Best Answer

#include <iostream>

using namespace std;

int main()

{

int x, y, z;

cout << "Enter 3 numbers: \n";

cin >> x;

cin >> y;

cin >> z;

if(x < y && x < z)

{

cout << x << " ";

if(y < z)

{

cout << y << " " << z;

}

else if(z < y)

{

cout << z << " " << y;

}

}

else if(y < x && y < z)

{

cout << y << " ";

if(x < z)

{

cout << x << " " << z;

}

else if(z < x)

{

cout << z << " " << x;

}

}

else if(z < y && z < x)

{

cout << z << " ";

if(y < x)

{

cout << y << " " << x;

}

else if(x < y)

{

cout << x << " " << y;

}

}

char wait;

cin >> wait;

return 0;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: A c plus plus program to read in three integer numbers and print them out in ascending order For example if the numbers input were 10 7 8 then your output would be 7 8 10?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What will be the program to arrange numbers stored in array in ascending order using pointers?

sorry


What happens when java program attempts to divide one integer by another?

In that case, unless you specifically convert ("cast") at least one of the numbers to a double or float, the result will also be an integer. Example: 1 / 3 = 0


Write a program for which give number in ascending number?

the following program will display all numbers given in the array in ascending order #include&lt;stdio.h&gt; void main() { int i,h,p; int numbers[10]={5,8,3,2,6,7,9,4,1,10}; for(p=0;p&lt;=8;p=p+1) { for(i=0;i&lt;=8;i=i+1) { if(numbers[i]&gt;numbers[i+1]) { a=numbers[i]; numbers[i]=numbers[i+1]; numbers[i+1]=a; } } } for(i=0;i&lt;=9;i=i+1) { printf("%d ",numbers[i]); } }


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


How can you write a c program to display numbers in ascending order in array?

I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.


How do you find sum of 100 numbers using fortran programme?

The following is for F95 and later (due to the use of intrinsic SUM ): My assumptions: -Your numbers are integers -Your numbers are stored in an array -The numbers you are describing are 0-100 program findSum !I assumed integer, replace this with your data type integer, dimension(100) :: numbers integer :: sumOfNumbers !We populate an array with our numbers !Replace this with your numbers do i=1,(size(numbers)+1) numbers = i end do !We find the sum of those numbers sumOfNumbers = sum(numbers) !We write out the sum to prompt write(*,*) 'Sum is: ', sumOfNumbers end program findSum


Demonstrate a program that prints numbers in ascending order.?

#include&lt;iostream&gt; int main() { for (int i=0; i&lt;100; ++i) std::cout&lt;&lt;i&lt;&lt;std::endl; }


Write a java program to sort a list of numbers?

The simplest would be to put the numbers into an int[] (integer array) and pass that to java.util.Arrays.sort(int[]) (a static method), which will sort the array in ascending numerical order. Use a float[] or double[] if you need to sort non-whole numbers. You can also use the Collections.sort(List) method to sort the List directly. Or the Collections.sort(List, Comparator) if you wish to specify your own sorting criteria.


Ascending order program for java?

public class BubbleSortAscendingOrderDemo { public static void main(String a[]) { //Numbers which need to be sorted int numbers[] = {23,5,23,1,7,12,3,34,0}; //Displaying the numbers before sorting System.out.print("Before sorting, numbers are "); for(int i = 0; i &lt; numbers.length; i++) { System.out.print(numbers[i]+" "); } System.out.println(); //Sorting in ascending order using bubble sort bubbleSortInAscendingOrder(numbers); //Displaying the numbers after sorting System.out.print("Before sorting, numbers are "); for(int i = 0; i &lt; numbers.length; i++) { System.out.print(numbers[i]+" "); } }


Write a program to compute the sum of first ten integer numbers in PHP?

$n = 10*(1+10)/2;


What is the code of a c program that will read in a positive integer value and determine If the integer is a prime number and If the integer is a Fibonacci number?

see the program


Write a C program that prompts the user for three decimal numbers and prints them trimmed as integer values. For example, if the user informs the values 13.2, 12.5, 102.231, the program prints out 13, 12, 102?

Here's a simple C program that prompts the user for three decimal numbers, converts them to integers, and prints the trimmed integer values: c Copy code #include int main() { double num1, num2, num3; // Prompt the user for three decimal numbers printf(&quot;Enter three decimal numbers: &quot;); scanf(&quot;%lf %lf %lf&quot;, &amp;num1, &amp;num2, &amp;num3); // Convert and print the trimmed integer values int intNum1 = (int)num1; int intNum2 = (int)num2; int intNum3 = (int)num3; printf(&quot;Trimmed integer values: %d, %d, %d\n&quot;, intNum1, intNum2, intNum3); return 0; } In this program: We declare three variables num1, num2, and num3 to store the decimal numbers entered by the user. We use printf to prompt the user to enter three decimal numbers. We use scanf to read and store the user's input in the variables num1, num2, and num3. We then convert these decimal numbers to integers by casting them using (int) and store them in intNum1, intNum2, and intNum3. Finally, we use printf again to print the trimmed integer values. Compile and run the program, and it will prompt you for three decimal numbers and print their trimmed integer values as requested.