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

a debate proposing the motion that anti corruption agencies in Nigeria are effective​
__________ were peasants who worked land for a lord in medieval Europe. a. Vassals b. Serfs c. Fiefs d. Knights
Match the sentence with the correct word: Nous _______ aller au cinéma. Les enfants ________ faire les devoirs. Tu _________ voyager en Europe. Vous ________
Would you agree to the recording of all private ceremonies, why or why not? From The Giver
What are the characteristics of gingivitis?​
 A study found that healthy eating can help to cut the risk of heart disease. Therefore, a person can conclude that if they eat healthy they definitely will
How would you write 845 as a multiplication expressions A. 8x5 B. 8x8x8x8x8 O c. 5x5x5x5x5x5x5x5
12^-2 in the simplest form
the examination was very dificult, very few were able to pass
You are a student in Danang city. You will describe your neighborhood for new students. You should say: 1/ Where to buy food 2/ Where to buy furniture 3/ Where