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

The diagram below describes a series of events during the 1700s. A flowchart of four boxes, the ones on the left pointing to the ones on the right. The first b
What is 1.7 as a fraction?
Choose the simple predicate in the following sentence. The men finished the game in a short time. A. finished B. game C. men D. time
The standard baseball measures 2 11/16" in diameter. What is its volume (to the nearest hundredth)?
what is the mass of 1 mole of barium acetate
what does dominance refer to in genetics
If 60% of a number is 18 what is 90% of the number
0.55 as fractionin simplest form
Given a force of 56 n and an acceleration of 7 m\s2, what is the mass
Which of these statements correctly expresses a similarity between ancient India and ancient China? A. Both developed democratic governments. B. Both followed