Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started