Question: Identify the errors and rewrite the correct statement #include #include 3 main(){ 4 int i,j,x[8]; 5 double sum; 6 int prod=1; 7 for(i=0;i
Identify the errors and rewrite the correct statement
- #include
- #include
3 main(){
4 int i,j,x[8];
5 double sum;
6 int prod=1;
7 for(i=0;i<=8;i++)
7 scanf(%d,x[i]);
8 for(j=0;j<8;j++){
9 if(abs(x[i])%2== 1)
10 sum+=x[i];
11 else
12 prod*=pow(x[i],2)
13 }
14 printf(sum=%f and prod=%d,sum,prod);
15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
