Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Bubble sort C program:
Write a program to define a bubble sort.
void main()
{
clrscr();
int a[100],ch,n;
cout<<"enter the limit for the array : ";
cin>>n;
for (int i=0;i { cout<<"enter element "< cin>>a[i]; } clrscr(); cout<<"1. bubble sorting"< bsort(a,n); } } void bsort(int a[100],int n) { clrscr(); int i,j,ch2,t; cout<<"1. ascending order "< cout<<"2. descending order "< cout<<" your choice : "; cin>>ch2; switch(ch2) { case 1 : for (i=0;i { for (j=0;j { if (a[j] > a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; case 2 : for (i=0;i { for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
cout<<"enter element "<
cin>>a[i];
}
cout<<"1. bubble sorting"< bsort(a,n); } } void bsort(int a[100],int n) { clrscr(); int i,j,ch2,t; cout<<"1. ascending order "< cout<<"2. descending order "< cout<<" your choice : "; cin>>ch2; switch(ch2) { case 1 : for (i=0;i { for (j=0;j { if (a[j] > a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; case 2 : for (i=0;i { for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
bsort(a,n);
void bsort(int a[100],int n)
int i,j,ch2,t;
cout<<"1. ascending order "< cout<<"2. descending order "< cout<<" your choice : "; cin>>ch2; switch(ch2) { case 1 : for (i=0;i { for (j=0;j { if (a[j] > a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; case 2 : for (i=0;i { for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
cout<<"2. descending order "< cout<<" your choice : "; cin>>ch2; switch(ch2) { case 1 : for (i=0;i { for (j=0;j { if (a[j] > a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; case 2 : for (i=0;i { for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
cout<<" your choice : ";
cin>>ch2;
switch(ch2)
case 1 : for (i=0;i { for (j=0;j { if (a[j] > a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; case 2 : for (i=0;i { for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
for (j=0;j { if (a[j] > a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; case 2 : for (i=0;i { for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
if (a[j] > a[j+1])
t=a[j+1];
a[j+1]=a[j];
a[j]=t;
break;
case 2 : for (i=0;i { for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
for (j=0;j { if (a[j] < a[j+1]) { t=a[j+1]; a[j+1]=a[j]; a[j]=t; } } } break; default : cout<<" wrong choice "; } cout<<" sorted arrays by bubble "<<"\n\n"; for (i=0;i { cout< } getch(); }
if (a[j] < a[j+1])
default : cout<<" wrong choice ";
cout<<" sorted arrays by bubble "<<"\n\n";
for (i=0;i { cout< } getch(); }
cout< } getch(); }
getch();
Goal: Design a program that computes square matrix multiplication on GPU using CUDA. Write the code in C. In particular, your implementation should obey the following requiremen
Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code
Why are all header files not declared in every C program? - Declaring all header files in each program would result in increase in overall file size and load of the program. It
Define F u n c t i o n? T h e r e a r e t w o t y p e s o f f u n ct i o n b u i l t - i n f un ct i o n s a n d u
Operation on array: void Array::add( Object& toAdd ) { lastElementIndex++; while( ptrAt( lastElementIndex ) != ZERO && lastElementIndex
A student apears in exam of math, physics, and chemistry. Write a program to find the total marks aa student has aqueired find the average.
Program is to define a class as employee: Write a program to define a class as employee and collect information about them by using classes and object class employee {
PROCEDUAL PROGRAMMING INTRODUCTION
Write a program to determine V c for a given value of time (t) #include stdio.h #include math.h void main() { char prompt; float vs,cr,t,vc; /* input time */
write a static method with one integer parameter, x that returns the value of the polynomial 3x(2)- 7x + 2
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd