Follow

Follow

Answered

In Technology

include<stdio.h> main() { printf("Enter Order Of The Matrix\\n"); int l,m; int i,j,k,t,x; scanf("%d%d",&l,&m); int a[l][m],tem…p[l*m]; printf("Enter The Elements Row Wise...\\n"); for(i=0;i<l;i++) { for(j=0;j<m;j++) { scanf("%d",&a[i][j]); } } printf("Matrix A \\n "); for(i=0;i<l;i++) { printf("\\n"); for(j=0;j<m;j++) { printf("%d\\t",a[i][j]); } } /*----------------------------------------------------------------------*/ x=0; for(i=0;i<l;i++) { for(j=0;j<m;j++) { temp[x]=a[i][j]; x++; } } for(i=0;i<l*m;i++) { for(j=0;j<(l*m)-1;j++) { if(temp[j]>temp[j+1]) { t=temp[j]; temp[j]=temp[j+1]; temp[j+1]=t; } } } x=0; for(i=0;i<l;i++) { for(j=0;j<m;j++) { a[i][j]=temp[x]; x++; } } printf("\\nMatrix A After Sort \\n "); for(i=0;i<l;i++) { printf("\\n"); for(j=0;j<m;j++) { printf("%d\\t",a[i][j]); } } } (MORE)

Answered

In Computers

Computer programmers use an array to arrange digits of a number in ascending order. The program uses character array to store the digits and a quick sort feature to sort t…hem. (MORE)

Answered

include <iostream> #include <vector> using namespace std; int main() { int temp = 0; vector<int> num; cout << "Enter 10 numbers: " << endl…; for(int i = 0; i < 10; i++) { cin >> temp; num.push_back(temp); } sort(num.begin(), num.end()); for(int i = 0; i < 10; i++) { cout << num.at(i) << endl; } return 0; } (MORE)

Answered

In Education

void main(){int a,b,c;clrscr();printf("Enter the value of a:");scanf("%d",&a);printf("\\nEnter the value of b:");scanf("%d",&b);printf("\\nEnter the value of c:");scan…f("%d",&c);if(a>b){if(a>c){if(b>c){printf("c is smallest\\n");printf("b is middle\\n");printf("a is largest\\n");}else{printf("b is smallest\\n");printf("c is middle\\n");printf("a is largest\\n");}}else{printf("b is smallest\\n");printf("a is middle\\n");printf("c is largest\\n");}}elseif(b>c){if(a>c){printf("c is smallest\\n");printf("a is middle\\n");printf("b is largest\\n");}else{printf("a is smallest\\n");printf("c is middle\\n");printf("b is largest\\n");}}else{printf("a is smallest\\n");printf("b is middle\\n");printf("c is largest\\n");}getch();} (MORE)

Answered

include<stdio.h> #include<conio.h> void main() { int i,j,temp,a[7]; clrscr(); printf("Enter 7 integer numbers: \\n"); for(i=0;i<7;i++) scanf("%d",&a…[i]); for (i=0;i<7;i++) { for(j=i+1;j<7;j++) { if(a[i]<a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } printf("\\n\\nThe 7 numbers sorted in ascending order are: \\n"); for(i=0;i<7;i++) printf("%d\\t",a[i]); getch(); } (MORE)

A spreadsheet in Excel is comprised of a grid of cells. Each cell (which is defined as the intersection between a row and a column) can be allocated its own attributes. This i…s how cells are formatted. The most important attribute for any cell is the number type. This attribute (MORE)

In Craft Tips

Your preschool-aged child is at a point in his or her young life when learning is incredibly fun and entertaining. Even though attention spans are very short, their ability to… learn new concepts is quick. You can foster further learning and early math skills by creating experiences surrounding counting and (MORE)

In Puzzles

Test your brain power every day with a few number games for adults online. Memory and math games improve your thinking skills and enhance your brain to act quickly in order to… solve puzzles. These websites offer a full selection of number games and other puzzles to help you improve (MORE)

In Bible

The book of Numbers is the fourth book in the Bible. It chronicles the history of the Hebrew people, following the giving of the Ten Commandments to Moses at Mount Sinai. It i…s part of the Pentateuch and part of the Jewish Torah. As such, it is an important part (MORE)

Answered

In Technology

#include<stdio.h>#include<conio.h> void main() { int num[10],i,j,temp; clrscr(); printf("\\n Enter 10 values of an array.....\\n"); for(i=0;i<10;i++) scanf("%d"…,&num[i]); printf("\\n array before sort ....\\n"); for(i=0;i<10;i++) printf("%d\\t",num[i]); for(i=0;i<9;i++) { for(j=i+1;j<10;j++) { if(num[i]<num[j]) { temp=num[i]; num[i]=num[j]; num[j]=temp; } } } printf("\\n array after sort .........\\n"); for(i=0;i<10;i++) printf("%d\\t",num[i]); getch(); } (MORE)

Answered

In Technology

It should be fairly simple to program a bubble sort (though this is not very efficient for large arrays). If elements #0 and #1 of an array are out of order, exchange them. Th…en do the same with elements #1 and #2, etc., up to elements number (n-2) and (n-1). Then go back to the beginning, and repeat everything (n-1) times. (This will require two nested for loops.) (MORE)

Answered

In Technology

include <stdio.h> #include <conio.h> int main() { int a[10],i,j,temp=0; printf("Enter all the 10 numbers"); for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=0;…i<10;i++) //This loop is for total array elements (n) { for(j=0;j<9;j++) //this loop is for total combinations (n-1) { if(a[j]>a[j+1]) //if the first number is bigger then swap the two numbers { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } } printf("The ordered array is"); for(j=0;j<10;j++) //Finally print the ordered array printf("%d \\t",a[j]);getch(); return 0; } (MORE)

Answered

#include <stdio.h> main() { int n,i,j,a[10][10],t; clrscr(); printf("enter the limit of an array\\n"); scanf("%d",&n); printf("enter the elments of an a…rray\\n"); for(i=1;i<=n;i++) scanf("%d",&a[i]); for(j=1;j<=n-i;j++) scanf("%d",&[j+1]) { t=a[j]; a[j]=a[j+1]=t; } printf("the numbers after sorting are:\\n"); for(i=1;i<=n;i++) printf("%d\\t",a[i]); getch(); } (MORE)

Answered

// simple bubble sort - ellipses (...) used to indicate indentation for clarity// an array - size 20 - could be anythingint a[20] = {1, 7, 5, 3, 7, 9, 67, 4, 20, 45, 76, 23, -…1, -5, -8, 12, 67, 45, 23, 34 };int swapflag = 1;int i;while (swapflag == 1) {... swapflag = 0;... for (i=0; i<19; i++)... ... if (a[i] < a[i+1]) {... ... ... swapflag = 1;... ... ... a[i] ^= a[i+1];... ... ... a[i+1] ^= a[i];... ... ... a[i] ^= a[i];... ... }... }} (MORE)