Pages
HOME
DEVELOPERS
PROJECTS
PROGRAMS
TUTORIAL
DATA STRUCTURE & ALGORITHM
HELP
Program to find SUM of an array using pointer
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int *p,sum=0;
int x[5]={4,10,7,5,12};
p=x;
for(int i=0;i<5;i++)
{
sum = sum + *p;
p++;
}
cout<<sum;
getch();
}
Newer Post
Older Post
Home