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

What is the general form of the equation for the given circle?
I had formerly, upon occasion, discoursed with my master upon the nature of government in general, and particularly of our own excellent constitution, deservedl
Sc. 2, Lines 82–90: In which lines does Hamlet ridicule Osric? Which lines criticize a social custom?
Will mark brainliest and 20 points How many 1-inch cubes do you need to create a cube with an edge length of 7 inches?
Which of these factors affect nutritional needs? Check all that apply. 1.)age 2.)activity level 3.)pregnancy 4.)marital status 5.)health status
What fraction do you divide first in a word problem.
In an animal,how is the dna from this organelle inherited
I need the value of x. Show all your work or no points. Please explain thoroughly.
Read this excerpt from "The Pedestrian" by Ray Bradbury in which Leonard Mead considers how technology has isolated people: Everything went on in the tomblike h
What is 900000000*80000000/98