Skip to main content

a C program for SORTING

bubble sort.

My dear friends , today we will discuss a program on sorting.

How we can sort a list in ascending or an descending order with the help of C  program.
Here is the program
#include<stdio.h>
#include<conio.h>
void main()
{ clrscr();
int i,j,temp,n,array[100];
printf(“\n how much and enter the elements for array”);
scanf(“%d”,&n)
for(i=0;i<n;i++);
scanf(“%d”,&array[i]);
for(i=0;i<n;i++)
{ for(j=0;j=n-i-1;j++)
{ if(array[j]>array[j+1])
    { temp=array[j];
      array[j]=array[j+1];
      array[j+1]=temp;
   }
 }
}
Printf(“\n array in sorted  order is”);
for(i=0;i<n;i++)
printf(“%d”,array[i]);
getch();

}

Comments

Popular posts from this blog

Hack the whatsapp

with this app you all can hack the whatsapp account of someone. enjoy hacking. with hacking i mean access to someone whatsapp without touching their phone. but first of all you need an access to their cell phone .  here is the app . note this may not be available in playstore. download from here and proceed step step as the app indicates.  size of app is less than 1 MB . thanks and keep visiting. see my others post also. WhatsApp Hack By: calmantez 4.5 /5 Using AIO Downloader Download whatever app you want for free. FILE PERMISSION DESCRIPTION AddThis Sharing Buttons Share to Facebook 203 Share to Twitter Share to Google+ Share to WhatsApp Share to More 2.2K File Name: WhatsApp Hack App Download Version: 1.0 (1) Price: Free APK Size: 0.19 MB Downloads: 500 Last Update Time: Jun 15, 2016 Min: Android 2.2.x (FROYO) Target: Android 4.4 (KITKAT) Screens: small, normal, large, xlarge Densities: 160, 240, 320, ...

Basics of python

Chapter 1 – Python Basics Read the author's other free Python books: Python Basics Lesson 2 - Expressions, Data Types, & Variables The Python programming language has a wide range of syntactical constructions, standard library functions, and interactive development environment features. Fortunately, you can ignore most of that; you just need to learn enough to write some handy little programs. You will, however, have to learn some basic programming concepts before you can do anything. Like a wizard-in-training, you might think these concepts seem arcane and tedious, but with some knowledge and practice, you’ll be able to command your computer like a magic wand to perform incredible feats. This chapter has a few examples that encourage you to type into the interactive shell, which lets you execute Python instructions one at a time and shows you the results instantly. Using the interactive shell is great for learning what ...