+ 2
How to do SUM OF SQUARES of elements in an array using 'C'(for inputing values)😅
1 Antwort
+ 4
#include <stdio.h>
#include<math.h>
int main() {
int arr[10]={1,2,3,4,5,6,7,8,9,10};
int sum=0;
for(int index=0;index<10;index++)
{
sum=sum+pow(arr[index],2);
}
printf("Sum-> %d",sum);
return 0;
}