Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *Source code by diofaprogsoft
- */
- #include <stdio.h>
- #include <iostream>
- using namespace std;
- int main(){
- int A[10],tmp; int n,i,j;
- cout<<"Enter the number of times input value : ";
- cin>>n;
- cout<<"\n";
- for(i=1;i<=n;i++){
- cout << "Value - "<<i<<" : ";
- cin>>A[i];
- }
- cout<<"\nSorted : ";
- for(j=1;j<=n;j++){
- for(int k=j+1;k<=n;k++){
- if(A[j]>A[k]){
- tmp=A[k];
- A[k]=A[j];
- A[j]=tmp;
- }
- }
- cout<<A[j]<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement