Question

write a C++ program to display the following pattern pattern Մ 6 6 7 7 8 8 9 9 10 00 00 Մ Մ NNNNNNNNN mmmmmmmm Մ Մ Մ Attach F

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here, nested 'for' loop is used in order to get the required output.

Initially declare variables i and j next, within main function use the nested for loop for 10 times in order to

print the output after every line print nextline that is " \n ".

program:

#include<iostream>
using namespace std;
int main()
{
   int i,j;
   for(i=10;i>=1;i--)
   {
       for(j=1;j<=i;j++)
       {
           cout<<j<<" ";
       }
       cout<<"\n";
   }
}

ouput:

1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1

Add a comment
Know the answer?
Add Answer to:
write a C++ program to display the following pattern pattern Մ 6 6 7 7 8...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • My Grades * Question Completion Status: Tools Save and Submit A Click Submit to complete this...

    My Grades * Question Completion Status: Tools Save and Submit A Click Submit to complete this assessment. << < Question 14 of 14 Question 14 10 points Save Answer 00 n! Σ x" no (2n)! Find the radius of convergence and the interval of convergence for the above series. Write your complete answer (with steps and explanations) to a paper and upload the scan. (You should use "Adobe Scan", just like the midterm) Attach File Browse My Computer Browse Content...

  • it is c++ for question 2 it has multiple parts QUESTION 2 Write a program to...

    it is c++ for question 2 it has multiple parts QUESTION 2 Write a program to generate N 20 random number in between 0 to N and [Q2] sort then descending [Q3jand ascending [Q4]Now define vector int> even to put the sorted evens [Q5]convert the sorted even in a range of 0 to 2*M_PI and print out their sind 1/ you might upload ans as different files or just one file Attach File Browse My Computer Browse Content Collection Browse...

  • 10 points Save Answer Find Fourier Cosine series of f(x) = sinx on (0,7). Attach File...

    10 points Save Answer Find Fourier Cosine series of f(x) = sinx on (0,7). Attach File Browse My Computer for Copyright eared File Browse Content Collection Click Submit to complete this assessment Question 3 of 3

  • The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that...

    The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that will receive two function handles from elementary math functions which accept a vector to first sort in ascending order then calculate. The script will display the results in two separate Figure Windows with the function names in the title. Submit: fnfr_plot.m Browse My Computer Attach File QUESTION 4 Generate 1x100 random vector, x in the range of 0<x<100 by using rand. Input 2 elementary...

  • Attach File Browse My Computer Browse Content Collection QUESTION 6 The drum has a weight of...

    Attach File Browse My Computer Browse Content Collection QUESTION 6 The drum has a weight of 100 lb and rests on the floor for which the coefficient of static Friction is us =0.5. If a 3 ft and b 4 ft, determine the smallest magnitude of the force P that will cause impending motion of the drum. FBD 5 points calculation 7 points Final answer 3 points Browse Content Collection Browse My Computer Attach File Save All Answers Click Save...

  • > AClick Submit to complete this assessment. Question 20 Identify which of the following is NOT...

    > AClick Submit to complete this assessment. Question 20 Identify which of the following is NOT conjugated acid-base pair: HBr/HBrO CI/HCI CH3COOH/CH3COO NH3/NH4+ A Moving to another question will save this response. Question 19 Determine the [H30+] for a solution that has a pH of 7.45. (submit your answer via a lin Attach File Browse My Computer Browse Content Collection BI A Moving to another question will save this response.

  • LUULIS spend scuoying per week have a distribution skewed to the right with a mean of...

    LUULIS spend scuoying per week have a distribution skewed to the right with a mean of 8.6 hours and a standard deviation of 28 houm Find the probability that the mean time spent studying per week for a random sample of 49 college students would be between 8.2 and 8.9 hours. Round your answer to two decimal places. Attach File Browse My Computer Browse Content Collection Browse Dropbox QUESTION 4 Let x denote the time it takes to run a...

  • Tommy Wait, a minor league baseball pitcher, is notorious for taking an excessive amount of time...

    Tommy Wait, a minor league baseball pitcher, is notorious for taking an excessive amount of time between pitches. In fact, his times between pitches are normally distributed with a mean of 32 seconds and a standard deviation of 2.8 seconds. What percentage of his times between pitches are longer than 36 seconds? Round to the nearest percent. Attach File Browse My Computer Browse Content Collection Browse Dropbox Browse Content Collection QUESTION 3 The times that college students spend studying per...

  • The times that college students spend studying per week have a distribution skewed to the right...

    The times that college students spend studying per week have a distribution skewed to the right with a mean of 8.6 hours and a standard deviation of 2.8 hours. Find the probability that the mean time spent studying per week for a random sample of 16 college students would be more than 9.1 hours. Round your answer to two decimal places. Attach File Browse My Computer Browse Content Collection Browse Dropbox QUESTION 7 The GPAs of all students enrolled at...

  • Let x denote the time it takes to run a road race. Suppose x is approximately...

    Let x denote the time it takes to run a road race. Suppose x is approximately normally distributed with a mean of 195 minutes and a standard deviation of 24 minutes. If one runner is selected at random, what is the probability that this runner will complete this road race in less than 187 minutes? Round your answer to four decimal places. Attach File Browse My Computer Browse Dropbox Browse Content Collection QUESTION 5 The GPAs of all students enrolled...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT