Dear Sir,
we are required the bubble sorting programs
Regs
Prem
Answer Posted / 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 |
Post New Answer View All Answers
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
Explain what is the benefit of using #define to declare a constant?
What is #line in c?
Compare interpreters and compilers.
Explain threaded binary trees?
Write a program for Overriding.
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
Is multithreading possible in c?
Tell me about low level programming languages.
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Why is C language being considered a middle level language?
What do you mean by c what are the main characteristics of c language?
How do I determine whether a character is numeric, alphabetic, and so on?
how many errors in c explain deply