ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
Dear Sir,
we are required the bubble sorting programs 

Regs
Prem
 Question Submitted By :: Premshriwas
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Dear Sir, we are required the bubble sorting programs Regs Prem
Answer
# 1
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 0 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what does data structure mean?  7
what is the difference between arrays and linked list Tech-Mahindra15
main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output?? Ramco13
what is the differance between pass by reference and pass by value. Infosys4
Write a program to generate prime factors of a given integer?  1
Why preprocessor should come before source code?  2
What's the difference between calloc() and malloc()?  3
N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3 Honeywell2
what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above Accenture2
do ne body have any idea about the salary for the we r going to have interview. yup .. u got it right ..i m talking abt NIC.  1
regarding the scope of the varibles;identify the incorrect statement: a.automatic variables are automatically initialised to 0 b.static variables are are automatically initialised to 0 c.the address of a register variable is not accessiable d.static variables cannot be initialised with any expression TCS1
What does a run-time "null pointer assignment" error mean?  2
what is the maximum no. of bytes calloc can allocate Mphasis2
Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... } TCS4
IS STRUCTURES CAN BE USED WITHIN AN ARRAY? Caritor7
Total of how many functions are available in c?  2
what is difference between ++(*p) and (*p)++ Accenture15
In the following code segment what will be the result of the function, value of x , value of y { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); } a) same, MAXINT, -1 b) not same, MAXINT, -MAXINT c) same , MAXUNIT, -1 d) same, MAXUNIT, MAXUNIT e) not same, MAXINT, MAXUNIT IBM1
different between overloading and overriding  3
a.One Cannot Take the address of a Bit Field b.bit fields cannot be arrayed c.Bit-Fields are machine Dependant d.Bit-fields cannot be declared as static Which of the Following Statements are true w.r.t Bit-Fields A)a,b&c B)Only a & b C)Only c D)All Accenture2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com