Answered step by step
Verified Expert Solution
Link Copied!

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

  1. #include
  2. #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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago