c++ loops

#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>

using namespace std;

int main()
{
    int counter = 1;
    int number = 0;
    int largest = 0;
    int n;
    cin >> n;
    int occurrence = 0;

    cout << "Please enter up to 10 numbers and I will print the largest one on the screen.\n\n";

    while (counter <= n)
    {
        cout << "Number: ";
        cin >> number;
        
        if (largest < number)
        {
            largest = number;
            occurrence = 1;
            
        }
        else if (number == largest)
        {
            occurrence++;
        }
        if (number == 0)
        {
            break;

        }
            counter++;
    }

    cout << "the largest number is "<<largest << endl;
    cout << "  the occurrence count " << largest << " is " << occurrence << " time";


	

}
#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>

using namespace std;

int main()
{

	int f1 = 0, f2 = 1;
	int nextTerm = 0;
	for (int i = 1; i < 10; i++)
	{
		//print first 2 numbers
		if (i == 1)
		{
			cout <<  f1<<" ";
			continue;
		}
		if (i == 2)
		{
			cout << f2 << " ";
			continue;
		}
		
		nextTerm = f1 + f2;
		f1 = f2;
		//make f2 = the next term
		f2 = nextTerm;
		cout << nextTerm<<" ";

	}

	
	

	
	
}

	
	

#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>

using namespace std;

int main()
{
	for (int i = 0; i < 8; i++)
	{
		for (int k = 0; k <= i; k++)
		{
			cout << "  ";
		}
		for (int j = i; j < 8; j++)
		{
			cout <<" "<< static_cast<char>(j+97-i);

		}
		for (int j = 7; j >= i; j--)
		{
			cout << " " << static_cast<char>(j + 97 - i);
		}
			cout << "\n";
	}
		

}

	
	

	
	

#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>

using namespace std;

int main()
{

	cout << "Enter two positive numbers ";
	int n1,n2;
	cin >> n1>>n2;
	int d = 1;
	int gcd = 1;
	
	if (n1 < n2)
		d = n1;
	else
		d = n2;
	while (true)
	{
		if (n1 % d == 0 && n2 % d == 0) {
				gcd = d;
				break;
		}
			
		d--;
	}
	
	cout << "the CGD of " << n1 << " and " << n2 << " is " << gcd;

	
	
		

	
	
}
 
#include<iostream>
#include <fstream>
using namespace std;
void selectionSort(double list[], int listSize);
int main()
{
    double list[] = { 3.4, 5, 3, 3.5, 2.2, 1.9, 2 };

    selectionSort(list, 7);
    for (int i = 0; i < 7; i++)
    {
        cout << list[i]<<" ";
    }
}
//decreasing order
void selectionSort(double list[], int listSize)
{
    for (int i = listSize-1; i >= 0 ; i--)
    {
        double currentMax = list[i];
        int currentMaxIndex = i;
        for (int j = i - 1; j >= 0; j--)
        {
            if (currentMax < list[j])
            {
                currentMax = list[j];
                currentMaxIndex = j;
            }
        }
            if (currentMaxIndex != i)
            {
                list[currentMaxIndex] = list[i];
                list[i] = currentMax;
            }
   
    }
}
//increasing order
void selectionSort(double list[], int listSize)
{
    for (int i = 0; i < listSize - 1; i++)
    {
        double currentMin = list[i];
        int currentMinIndex = i;
        for (int j = i + 1; j < listSize; j++)
        {
            if (currentMin > list[j])
            {
                currentMin = list[j];
                currentMinIndex = j;
            }
        }
            if (currentMinIndex != i)
            {
                list[currentMinIndex] = list[i];
                list[i] = currentMin;
            }
        
    }
}

Similiar Collections

Python strftime reference pandas.Period.strftime python - Formatting Quarter time in pandas columns - Stack Overflow python - Pandas: Change day - Stack Overflow python - Check if multiple columns exist in a df - Stack Overflow Pandas DataFrame apply() - sending arguments examples python - How to filter a dataframe of dates by a particular month/day? - Stack Overflow python - replace a value in the entire pandas data frame - Stack Overflow python - Replacing blank values (white space) with NaN in pandas - Stack Overflow python - get list from pandas dataframe column - Stack Overflow python - How to drop rows of Pandas DataFrame whose value in a certain column is NaN - Stack Overflow python - How to drop rows of Pandas DataFrame whose value in a certain column is NaN - Stack Overflow python - How to lowercase a pandas dataframe string column if it has missing values? - Stack Overflow How to Convert Integers to Strings in Pandas DataFrame - Data to Fish How to Convert Integers to Strings in Pandas DataFrame - Data to Fish create a dictionary of two pandas Dataframe columns? - Stack Overflow python - ValueError: No axis named node2 for object type <class 'pandas.core.frame.DataFrame'> - Stack Overflow Python Pandas iterate over rows and access column names - Stack Overflow python - Creating dataframe from a dictionary where entries have different lengths - Stack Overflow python - Deleting DataFrame row in Pandas based on column value - Stack Overflow python - How to check if a column exists in Pandas - Stack Overflow python - Import pandas dataframe column as string not int - Stack Overflow python - What is the most efficient way to create a dictionary of two pandas Dataframe columns? - Stack Overflow Python Loop through Excel sheets, place into one df - Stack Overflow python - How do I get the row count of a Pandas DataFrame? - Stack Overflow python - How to save a new sheet in an existing excel file, using Pandas? - Stack Overflow Python Loop through Excel sheets, place into one df - Stack Overflow How do I select a subset of a DataFrame? — pandas 1.2.4 documentation python - Delete column from pandas DataFrame - Stack Overflow