#include <iostream>
#include <vector>
using namespace std;
int main()
{
int temp = 0;
vector<int> num;
cout << "Enter 10 numbers: " << endl;
for(int i = 0; i < 10; i++)
{
cin >> temp;
num.push_back(temp);
}
sort(num.begin(), num.end());
for(int i = 0; i < 10; i++)
{
cout << num.at(i) << endl;
}
return 0;
}
To write a C++ program to display the student details using class and array of object.
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.
the following program will display all numbers given in the array in ascending order #include<stdio.h> void main() { int i,h,p; int numbers[10]={5,8,3,2,6,7,9,4,1,10}; for(p=0;p<=8;p=p+1) { for(i=0;i<=8;i=i+1) { if(numbers[i]>numbers[i+1]) { a=numbers[i]; numbers[i]=numbers[i+1]; numbers[i+1]=a; } } } for(i=0;i<=9;i=i+1) { printf("%d ",numbers[i]); } }
One many find this answer on YouTube. One also may find out how to write ascending order programs using an 8086 microprocessor by looking at the owners manual.
das
Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.
Write the numbers of a set in ascending order. If there is an odd number of numbers, the median is the one in the middle. If there is an even number of numbers, the median is the average of the middle two.
before and after use an conpair the results
Use a looping structure. The first step initialises a loop control variable, n, to zero. You then begin the loop by processing the nth element from the array (the process may be a simple print statement). You then increment n. Finally, you test the value of n; if it is less than 10 you start a new iteration of the loop, otherwise you proceed to the end of the flowchart.
0.01, 0.09, 0.1, 0.9
write a lex program to delete space from the program
write an assembly language program to find sum of N numbers