jamomoja88 jamomoja88
  • 02-01-2022
  • Computers and Technology
contestada

What is the C++ program to display 3 6 9 12 15​

Respuesta :

YBS20
YBS20 YBS20
  • 02-01-2022

Answer:

#include <iostream>

using namespace std;

int main()

{

   

   int n = 15;

   

   for(int i=3; i<=n; i=i+3){

       cout<<i;

       cout<<" ";

   }

   return 0;

}

Explanation:

Used for loop to calculate number and display it. for start with 3(int i=3), increment by 3(i=i+3) and stop when 15 came (i<=n where n is 15).

Answer Link

Otras preguntas

Britain saw its colonies as a source of
Find two consecutive numbers whose sum is 117
a Pontiac trans-am, initially at rest accelerates at a constant rate of 4.0 m/s squared for six seconds how fast will the car be traveling a T equals six second
Select the correctly punctuated sentence. -The men's choice of television program didn't agree with the Williams's or the childrens'. -The men's choice of telev
how was life before the industrial revolution different from the life after it
What caribbean countries have refugees come?
Some political theorists might argue that individual rights must, at times, be sacrificed to promote what?
Britain saw its colonies as a source of
An explosion causes debris to rise vertically. the formula h=-16t^2+48t describes the height of the debris above the ground, h, in feet, t seconds after the exp
I really need help with these and my dad said the way i originally did it was wrong.