Computer Science, asked by Kapue9121, 11 months ago

Write a program to find sum of differences between adjacent numbers in a array of positive integers

Answers

Answered by utkarshmishra9819
5

Answer:

class prog{

void main(int n)

{

int a[]=new int[n];

int k=0;

for(int i=1;i<n;i++)

{

k=k+(a[i]-a[i-1]);

}

System.out.println(k);

}}

Similar questions