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

Which of the kingdoms has the smallest number of known species
By the mid-1700s, the largest city in the colonies was (A) New York (B) Boston (C) Philadelphia (D) Charleston (E) Wilmington, Delaware
If Walt can paint 25 feet of fence in an hour, and Joe can paint 35 feet in an hour, how many minutes will it take them to paint a 150-foot fence, if they work
If 8 men can chop down 28 trees in one day, how many trees can 20 men chop down in one day?
which factor made the most difference in how agriculture affected the economies of the colonies?
Explain how a species can evolve through natural selection.
Explain how a species can evolve through natural selection.
Which of the following organisms can perform alcoholic fermentation? (1) yeast, (2) humans, (3) bacteria. a. 1 and 2 b. 1 and 3 c. 1 only d. 1, 2, and 3
The height of a rectangular prism with a 20 cm by 12 cm base and a 30 cm diagonal.find the unknown dimension
which factor made the most difference in how agriculture affected the economies of the colonies?