Logo 
Search:

C++ Programming Forum

Ask Question   UnAnswered
Home » Forum » C++ Programming       RSS Feeds

how i can Creat Desplay Sort Insert Delete element from Array

  Asked By: Murad    Date: Oct 21    Category: C++ Programming    Views: 1647
  

i have

1,3,5,7,9

i want to insert number 4 between 3 and 5 .


and i want to delete element .

i start with this !



#include <stdio.h>
#include <conio.h>
#include <process.h>


void creat ();
void display ();
void sort ();
void insert ();
void delet ();

long Array [5]= {1,3,5,7,9};
int i,ch;

void main ()
{



do
{
clrscr ();

printf ("\n main menue");
printf ("\n creat array");
printf ("\n display alist");
printf ("\n sort a number");
printf ("\n insert a number");
printf ("\n delet a number");
printf ("\n exit");

scanf ("%d",&ch);

switch (ch)
{
case 1 : creat ();

break ;

case 2 : display ();

break ;

case 3 : sort ();

break ;

case 4 : insert ();

break ;

case 5 : delet ();

break ;


case 6 : exit (0);
}
getch ();


}while (ch!=6);
}



void creat()
{
for (i=0; i<5; i++)
{
printf("\n id no [%d]= " ,i);
scanf("%d",& Array [i]);
}

}
void display()
{
for (i=0; i<5; i++)
printf("%d\n ", Array [i]);
}




do I'm i right ?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 




Tagged: