Dear Sir,
we are required the bubble sorting programs
Regs
Prem
Answer / vignesh1988i
DESCENDING ORDER Bubble sorting
#include<stdio.h>
#include<conio.h>
void main()
{
int a[100],n;
printf("enter the number of elements :");
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n-1;i++)
for(j=0;j<n;j++)
if(a[j]<a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
for(i=0;i<n;i++)
printf("%d\n",a[i]);
getch();
}
thank u
| Is This Answer Correct ? | 3 Yes | 1 No |
What is structure in c language?
Explain what math functions are available for integers? For floating point?
write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised
Write a program to remove the C comments(/* */) and C++ comments(//) from a file. The file should be declared in command line.
void main() {int a[5],i,b=16; for(i=0;i<5;i++) a[i]=2*i; f(a,5,b); for(i=0;i<5;i++) printf("\n %d",a[i]); printf("\n %d",b); } f(int *x,int n,int y) { int i; for(i=0;i<n;i++) *(x+i)+=2; y=y+2; }wat r the errors in the prg.and improvise the prg to get o/p.?
write a recursive program in'c'to find whether a given five digit number is a palindrome or not
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
What is a stream?
f(char *p) { p=(char *)malloc(sizeof(6)); strcpy(p,"HELLO"); } main() { char *p="BYE"; f(p) printf("%s",p); } what is the output?
9 Answers Hughes, Tech Mahindra,
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
11 Answers HCL, Vector, Vector India, Vector Solutions, Wipro,
What is wild pointer in c with example?
Who invented bcpl language?