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

Solve the equation: x - 9 = -6 + 5 A. 21 B. 7 C. 14 D. 2
Which of the following is an example of units for speed
I'm a polygon I have no parallel lines I am formed 3 line segments I have one right angle Two of my angles are angles What am I
PLZ HELP FAST Biotechnology is a growing field of applied biology. Many crops such as corn have been engineered to be resistant to herbicides. Therefore farmer
PLEASE HELP In a system, when potential energy decreases, then entropy also decreases. True False
How did Thomas Hobbes’s interpretation of the social contract differ from John Locke’s?
what ways did native Americans influence the lives of European settlers in early America ?
what is the correct tRNA sequence that would match the following mRNA sequence.GCGAUA
If 5x - 2 = -12, then x = A) -50 B) -4.4 C) -2.8 D) -2
Which event Occurred in the nearly two-year time span between act 3 and act4 of The Tragedy of Julius Caesar?