Logo 
Search:

C++ Programming Forum

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

I WANT THE CODING OF THESE PROBLEMS PLZ HELP:

  Asked By: Harshal    Date: Oct 04    Category: C++ Programming    Views: 865
  

1. Write a program to copy elements of one array into other empty array using pointer to array of integers.

2. Write a program to find out largest element of an array using pointer to array of integers.

3.Write a program to sort array elements in ascending order using pointer to array of integers.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Abhishek Singh     Answered On: May 23

#include<stdio.h>
#include<conio.h>
void main()
{
int a[12],b[12],c[12];
int *p,*q,*r;
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
//copy
p=&a;
q=&b;
for(i=0;i<5;i++)
{
*(p+i)=*(q+i);
p++;
q++
}
//after copy
for(i=0;i<5;i++)
{
printf("%d",*(b+i));
}

 
Didn't find what you were looking for? Find more on I WANT THE CODING OF THESE PROBLEMS PLZ HELP: Or get search suggestion and latest updates.




Tagged: