A vector is given by V 5 17 3 8 0 7 12 15 20 6 6 4 2 16 Wri
A vector is given by V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -2, 16]. Write a program that doubles the elements that are positive and are divisible by 3 or 5, and, raises to power of 3 the elements that are negative but greater than -5.![A vector is given by V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -2, 16]. Write a program that doubles the elements that are positive and are divisible by A vector is given by V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -2, 16]. Write a program that doubles the elements that are positive and are divisible by](/WebImages/13/a-vector-is-given-by-v-5-17-3-8-0-7-12-15-20-6-6-4-2-16-wri-1016304-1761525151-0.webp)
Solution
#include <stdio.in>
#include<math.h>
#include<conio.h>
main()
{
int n,ps,ns,I;
int a[50];
clrscr();
printf(“Enter no. of elements”);
scanf(“%d” &n);
for(i=0;i<n;i++)
{
scanf(“d”,&a[i];
}
for(i<0;i<n;i<i++)
{
If(a[i]>0)
{
If(a[i]%3==0|| a[i]%5==0)
{
ps = a[i]*2;
printf(“%d”ps);
}
}
else
{
If (a[i]>-5)
{
ns = pow(a[i],3)
printf(“%d”,ns);
}
}
}
getch();
}
This program has to be typed on turbo c.
& run & enter the vector v=(numbers);
![A vector is given by V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -2, 16]. Write a program that doubles the elements that are positive and are divisible by A vector is given by V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -2, 16]. Write a program that doubles the elements that are positive and are divisible by](/WebImages/13/a-vector-is-given-by-v-5-17-3-8-0-7-12-15-20-6-6-4-2-16-wri-1016304-1761525151-0.webp)
![A vector is given by V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -2, 16]. Write a program that doubles the elements that are positive and are divisible by A vector is given by V = [5, 17, -3, 8, 0, -7, 12, 15, 20, -6, 6, 4, -2, 16]. Write a program that doubles the elements that are positive and are divisible by](/WebImages/13/a-vector-is-given-by-v-5-17-3-8-0-7-12-15-20-6-6-4-2-16-wri-1016304-1761525151-1.webp)