code for bubble sort?

Answer Posted / ansar husain

void main()
{
int A[50];
int n,j,t ;
printf("enter the size of array:=>");
scanf("%d",&n);
printf("enter the %d value in array:=>%d",n);
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(A[i]>A[j])
{
i=a[i];
A[i]=a[j];
A[j]=t;
}
}
}
printf("after the shorting:=>\n");
for(i=0;i<n;i++)
{
printf("%d",A[i]);
}
getch();

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is void c?

571


What is the general form of a C program?

600


write a program to copy the string using switch case?

2404


How can you convert integers to binary or hexadecimal?

621


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

661






How can you access memory located at a certain address?

670


What is function prototype in c with example?

583


what is the difference between class and unio?

1865


What are the different types of C instructions?

681


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

782


Which is more efficient, a switch statement or an if else chain?

585


How can you find the day of the week given the date?

621


Explain built-in function?

595


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1629


What is p in text message?

543