Answer:
/*
* Program to print traingle using asterisk.
*/
#include<iostream>
using namespace std;
//Function to print n asterisk in a row.
void printAsterisk(int n)
{
for(int i = 0;i<n;i++)
cout<<"*";
}
int main()
{
//Variable to store size of trianle
int size;
cout<<"Enter the size of triangle"<<endl;
cin>>size;
//print asterik in increasing order line by line.
for(int i =0; i<size;i++)
{
printAsterisk(i);
cout<<endl;
}
//print asterik in decresing order line by line.
for(int i =size-1; i>0;i--)
{
printAsterisk(i-1);
cout<<endl;
}
}
Output:
Enter the size of triangle
10
*
**
***
****
*****
******
*******
********
*********
********
*******
******
*****
****
***
**
*
Explanation:
Since no programming language is mentioned therefore answer is provided in C++.
The above program will use two for loops to print the triangle using asterisk.
The first loop will print the asterisk line by line with each line having one more asterisk than the previous one till the size of the triangle.
The second for loop will print the asterisk using same logic as above but in reverse order.
Final output of triangle will be obtained.
Answer:
Abstraction
Explanation: Abstraction is a software engineer terminology that has been found to be very effective and efficient especially as it relates to object-oriented computer programming. It has helped software engineers and other computer experts to effectively manage account objects without having a knowledge of the details with regards to the Implementation process of that account object.
Suppose that you have the following definitions:struct time Type struct tourTypen the variable destination of type your type are tourType input(){cout<<"Enter the city, distance and time in hr and min"<>destination.city name;
<h3>What is C++ statements?</h3>
Expression statements. These statements examine an expression for its aspect outcomes or for its go-back value. Null statements. These statements may be supplied in which a declaration is needed with the aid of using the C++ syntax however in which no motion is to be taken.
- #include
- #include
- the use of namespace std;
- struct timeType
- ;
- struct tourType
- ;
- tourType destination;
- tourType input(){
- cout<<"Enter the city, distance and time in hr and min"<>destination.cityName;
- cin>>destination.distance;
- cin>>destination.travelTime.hr;
- cin>>destination.travelTime.min;
- go back destination;
- }
- void display()cityName;
- d.distance = t->distance;
- d.travelTime.hr = t->travelTime.hr;
- d.travelTime.min = t->travelTime.min;">
- int main().
Read more about the variable :
brainly.com/question/2804470
#SPJ1
Answer:
kinesthetical
Explanation:
please give brainliest please and good luck :)