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

Each verb below, one noun does not go with it. Which one? 1/ discover ( the truth, a cure, DNA, gold ) 2/ make ( cars, a discovery, a phone call ) 3/ tell ( hel
Simple Machine Lever: A ________ that pivots on top of a fixed point called a _______.
Video club A charged $10 for membership and $3 for movie rental. Video Club B charges $15 for membership and $2 per movie rental. For how many movie rentals wil
three things scientists learned about earth in beginning of 1800s
what is 1/9 of 60 equal
What is the value of the 8 and 48?
what derived unit is usually used to express the density of liquids?
25% of what nember is 19
what SI unit would best be used to express the height of your classroom ceiling ?
what other information do you need to prove triangle GHK is congruent to triangle KLG by SAS