Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the do while loop will be infinite if the input is 0 why when i run the program, it still give me 0 for output?

image text in transcribed the do while loop will be infinite if the input is 0 why when i run the program, it still give me 0 for output?

#include int counting, sum, repeat; maino sum = 1; printf(" Enter one positive integer number for counting"); scanf("%d",&counting); do { sum - sumcounting; counting = counting-1; }while(counting

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

=+ 2. What is the opportunity cost of seeing a movie?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago