#include
#include
void main()
{
int x[size], *p, *q, *r, temp,size;
clrscr();
printf("Number of elements to be entered:");
scanf("%d",&size);
p=x;
for(q=p; q
#include
void main()
{
int x[size], *p, *q, *r, temp,size;
clrscr();
printf("Number of elements to be entered:");
scanf("%d",&size);
p=x;
for(q=p; q
{
printf("\nEnter value:");
scanf("%d", q);
}
printf("\n\nkush\n");
printf("\n\nPrinting the elements in asceding order.......\n");
for(q=p; q
printf("\nEnter value:");
scanf("%d", q);
}
printf("\n\nkush\n");
printf("\n\nPrinting the elements in asceding order.......\n");
for(q=p; q
{
for(r=q+1; r
for(r=q+1; r
{
if(*q>*r)
{
temp=*q;
*q=*r;
*r=temp;
}
}
}
for(q=p; q
if(*q>*r)
{
temp=*q;
*q=*r;
*r=temp;
}
}
}
for(q=p; q
{
printf("%d ", *q);
}
getch();
}
printf("%d ", *q);
}
getch();
}
No comments:
Post a Comment