Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i got a problem in this c++ program i dont know how to reduce the number of spaces between each one of them this is

i got a problem in this c++ program i dont know how to reduce the number of spaces between each one of themimage text in transcribed this is my code

#include #include #include #include using namespace std; int main(){ /** * Three integer variables are declared below */ int start, stop, step;

/** * An integer named iterationCount is declared */ int iterationCount;

/** * Prompting user to enter start, stop and step values * inside a while loop * This while loop runs until all the constraints are not satisfied */ while(true){ cout>start>>stop>>step;

/** * Calculating iteration count */ iterationCount=(stop-start)/step + 1;

/** * Checking validity of each condition */ if(stop50){ cout

/**********************************************************/ /*** WRITTING DATA TO FILE NAMED number-table.txt ***/ /**********************************************************/

/** * Opening the file */ ofstream file; file.open("number-table.txt"); if(file.is_open()){ file

file

file

file

file

file

file

file

file

Output is nearly correct; but whitespace differs. See highlights below. Special character legend Input 1 10 1 NumberSquared Cubed Square-Root 16 25 3 6 4 9 64 81 100 27 64 125 216 343 512 729 1000 1.00000000 1.41421356 1.73205081 2.00000000 2.23606798 2.44948974 2.64575131 2.82842712 3.00000000 3.16227766 Your output 10 Number Squared Cubed Square-Root 16 25 3 6 49 64 81 100 27 64 125 216 343 512 729 1000 1.00000000 1.41421356 1.73205081 2.00000000 2.23606798 2.44948974 2.64575131 2.82842712 3.00000000 3.16227766 Expected output 10

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books