#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n,i,j,temp,a[50];
printf("Enter how many elements=");
scanf("%d",&n);
printf("Enter %d elements",n);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<=n-1;i++)
{
for(j=1;j<=n-1;j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
printf("\nSorted Array:\n");
for(i=1;i<=n;i++)
{
printf("\n%d",a[i]);
}
getch();
}
To write a C++ program to display the student details using class and array of object.
If you are using an array : sort using qsort() then take middle element.
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....
How to write a program for mouse in microprocessor?
To write a C++ program to display the student details using class and array of object.
If you are using an array : sort using qsort() then take middle element.
write an assembly language program to find sum of N numbers
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....
public static int[] reverseArray(int[] array) { int i = 0, j = array.length - 1; for (i = 0; i < array.length / 2; i++, j--) { int temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; }
How to write a program for mouse in microprocessor?
Reference:cprogramming-bd.com/c_page1.aspx# array programming
Use the Array Package. if you need help - add me on msn james_mc_123@hot dkjdkdjd mail.comp
array type
int findMax(int *array) { int max = array[0]; for(int i = 1; i < array.length(); i++) { if(array[i] > max) max = array[i] } return max; }
// Assuming you dynamically allocated this array using "new"... delete array[arraysize - 1]; arraysize--;