code for bubble sort?
Answer / 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 |
Differentiate between declaring a variable and defining a variable?
What does typedef struct mean?
What is wrong with this initialization?
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)
#include<stdio.h> #include<conio.h> int main() { int a[4][4]={{5,7,5,9}, {4,6,3,1}, {2,9,0,6}}; int *p; int (*q)[4]; p=(int*)a; q=a; printf("\n%u%u",p,q); p++; q++; printf("\n%u%u",p,q); getch(); return 0; } what is the meaning of this program?
Which is the best sort method for library management?
what is the use of #pragma pack, wer it is used?
What kind of sorting is this? SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort
How can you determine the maximum value that a numeric variable can hold?
What are the rules for identifiers in c?
Write a code on reverse string and its complexity.
When should the register modifier be used? Does it really help?