Write a program Using loops to display the following patterns –
(i)
**********
(ii)
********************
(iii)
*
**
***
****
*****
******
*******
********
*********
**********
(iv)
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
****************
*****************
******************
*******************
********************
(v)
**********
*********
********
*******
******
*****
****
***
**
*
(vi)
********************
*******************
******************
*****************
****************
***************
**************
*************
************
***********
**********
*********
********
*******
******
*****
****
***
**
*
Your program should use loops to display all 6 patterns with one execution.
Input from the keyboard: the number of rows,
the number of asterisks in the first row,
1 to increment asterisks in each following row, or
-1 to decrement the number in following rows, or
0 to keep the same number as in the first row.
Save this program as HW5Part1.cpp and upload the .cpp file to Blackboard.
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
#include <iostream>
using namespace std;
int main()
{
int i,n;
cout<<"Enter number of stars in a row: ";
cin>>n;
for(i=0;i<n;i++)
cout<<"*";
return 0;
}

// iii and iv
#include <iostream>
using namespace std;
int main()
{
int i,j,n;
cout<<"Enter number of rows: ";
cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
cout<<"*";
cout<<"\n";
}
return 0;
}

// v and vi
#include <iostream>
using namespace std;
int main()
{
int i,j,n;
cout<<"Enter number of rows: ";
cin>>n;
for(i=n;i>0;i--)
{
for(j=1;j<=i;j++)
cout<<"*";
cout<<"\n";
}
return 0;
}

Kindly revert for any queries
Thanks.
Write a program Using loops to display the following patterns – (i) ********** (ii) ******************** (iii)...
answer 8 using matlab
Using nested loops, traverse through the matrix for the following. a) Replace all elements divisible by 3 with 100. b) Replace all elements divisible by 2 with 50. c) Replace the first element of each row with 10. d) Display the all elements of the 2D matrix as a 10 array (9 elements in 1 row) 8) Write a function file that determines the maximum element of an input matrix A using nested loops and counts...
Write a C program for the following: (i) (ii) (iii) (iv) (v) A function to read an NxM matrix (from console input). A function to display the NxM matrix on the screen. A function to add these two matrices. A function to subtract these two matrices. A function to multiply these two matrices. The program must also contain a main function that will first declare two 3x3 matrices A and B, allow input of data for A and B (using...
use JOptionPane to display output Can someone please help write a program in Java using loops, not HashMap Test 1 Grades After the class complete the first exam, I saved all of the grades in a text file called test1.txt. Your job is to do some analysis on the grades for me. Input: There will not be any input for this program. This is called a batch program because there will be no user interaction other than to run the program....
USING FOR AND WHILE LOOPS-MATLAB) 6. Write a program to display the number in reverse order. Test Data : Input a number: 12345 Expected Output : The number in reverse order is : 54321
.using while loops(matlab) Write a program to display the sum of the series [ 9 + 99 + 999 + 9999 ...] Test Data : Input the number or terms :5 Expected Output : 9 99 999 9999 99999 The sum of the series = 111105
C++ Write a rudimentary spreadsheet program(include main). Display a grid of cells with columns A through H and rows 1 through 20. Accept input in the first row of the screen. The commands are of the form column row entry, where entry is a number, a cell address preceded by a plus (e.g., +A5), a string, or a function preceded by an at sign, @. The functions are: max, min, avg, and sum. During execution of your program, build and...
Lab 5-2 Nested Loops 2. Summation Of Numbers (using Nested While Loops) Part A: The program will calculate and display the total of all numbers up to a specific number (entered by the user). Only positive numbers are allowed. Part B: User-controlled loop Part A Input Validation loop Part A: Summation loop Examples: When 5 is entered the program will calculate the total as 1+2+...+5 and display 15. When 2 is enterered the program will calculate the total as 1+2...
Topics c ++ Loops While Statement Description Write a program that will display a desired message the desired number of times. The program will ask the user to supply the message to be displayed. It will also ask the user to supply the number of times the message is to be displayed. It will then display that message the required number of times. Requirements Do this assignment using a While statement. Testing For submitting, use the data in the...
Write a C++ program that creates a ragged table (i.e. a table with rows of different length) using a vector of vector of integers. Your program should prompt the user for a file name, open the file, read the content of the file and store it in a vector or vectors, and finally print the content of the vector of vectors. Sample Input: Enter the file name: data.dat A sample file might contain: 6 5 2 4 5 3 2...
Write a C program that should run on Linux platform using gcc
compiler. You are required to
simulate threads creation and termination behavior by using POSIX
threads library.
Input:
In the main program, first take the value for total number of
threads and then ask user to provide
the arrival time and CPU time (i.e. running time) for each
thread.
Output:
Simulate the behavior of threads arrival, working and termination
at a specific time interval (i.e.
500ms).
Requirements:
i. Name...