Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
C Program for SORTING OF NUMBERS
main()
{
int a[20],i,j,temp,n;
clrscr();
printf("ENTER THE MAXIMUM LIMIT: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
printf("ENTER %d ELEMENT: ",i);
scanf("%d",&a[i]);
}
for(i=1;i<=n-1;i++)
for(j=i+1;j<=n;j++)
if(a[i]>a[j])
temp=a[i];
a[i]=a[j];
a[j]=temp;
printf("\nTHE SORTED ELEMENTS ARE. \n");
for(j=1;j<=n;j++)
printf(" %d",a[j]);
getch();
OUTPUT :
ENTER THE MAX. LIMIT: 5
ENTER 1 NO: 5
ENTER 2 NO: 8
ENTER 3 NO: 10
ENTER 4 NO: 1
ENTER 5 NO: 2
THE SORTED ELEMENTS ARE:
1 2 5 8 10
Default argument: When the argument is missing then the function will read the default value of the missing argument. To make use of default argument functionality the argu
What is the difference between an external iterator and an internal iterator? Ans) An internal iterator is executed with member functions of the class that has items to step th
Writing and compiling a program from a given Use Case definition. Follow the Average Temperature in Paradise
C program to add, average and deviation of numbers: void main() { int sum=0,a[10],i; float avg=0,dev,vari=0,var; pri
Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with '
Program for calculate average of total marks: #include using namespace std; void print(int marks_arr[],int cnt) { int ind[cnt]; int i=0; int j=0; int k=0;
Unary Minus Operator( Negation) This operand can be used to negate the value of a variable. It is also used to state a negative number, here a minus(-) sign is prefixed to the
Control Flow The control flow statements are used when it is needed that the flow of the program is to be changed after taking some decision. This control flow statement theref
#include void func(int num, b=5) { auto int total=0; static int sum=0; for ( int i=num; i>0 ; i--) total+=i; sum+=total; cout
Should I call a destructor explicitly on a local variable?
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd