Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 2.9. Rewrite the product function of Exercise 2.8 using a for loop. exercise 2.7 code: #include int main() { int n,product=1,i=1; printf(Enter n value

Exercise 2.9. Rewrite the product function of Exercise 2.8 using a for loop.

exercise 2.7 code:

#include int main() { int n,product=1,i=1; printf("Enter n value : "); scanf("%d",&n); printf("i\tproduct "); while(i<=n) { printf("%d\t %d ",i,product); product *= i; i++; } printf("product of %d numbers are = %d ",i,product); return 0; }

language is in c.

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

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions