### Help C++

First, I wish you all a good day.

I'm trying to solve some problems in c ++ (I think it's important to let me know that I'm still a beginner and I don't understand the language very well). my doubt is the following: Because when I run the code in the case of question A for what reason the variable: why_f gives a random number, if possible someone could explain to me how I should fix it?

obs; this code is to determine which roads leave and certain roads reach city x
and which city has the highest number of studies

proposed exercise:

Consider cities numbered 0 through π - 1 that are connected by a series of one-way roads. The connections between cities are represented by the elements of a square matrix πΏπ π₯ π, elements elements πππ assuming the value 1 or 0, depending on whether or not there is a direct road that leaves city i and reaches city π. Thus, the elements of row π indicate the roads that leave the city π, and the elements of the column π indicate the roads that arrive in the city π. πΏ = [1 1 0 1 1 0 1 0 1 0 0 0 1 1 1 1] Create a program that, given a square matrix πΏπ π₯ π that represents a presented structure, has a function that proposes a solution or problem in each of the items below. Your program must have a menu in a loop for the user to choose which problem to solve or when they want to exit it, it must allow the user to enter the desired matrix once and, for each item, the user must enter new specific entries make trouble. Explain your idea for solving each of the proposed problems. NOTE: The number of columns can be corrected by you in the code, but it should allow you to change it easily, through a variable.

a) Given a user-defined city ka, determine the roads according to which roads reach the city.

b) Given the input matrix, which city has the highest number of roads that leave it?

#include <iostream>
#include <math.h>
#include <locale.h>
#set size 4
using std namespace;

int main ()
{
setlocale(LC_ALL, "English");
int opera_sum_or_subtra, m, i, j, columns2, rows2, city, path, counter;
int by_d, by_f, cities, counter_2;

int l [size] [size] = {1,1,1,0,
0.1,1.0,
1.0,1.1,
0.0,1.1};

//

cout << "\ nchoose whether you want to answer question A or question B \ if you want to type it: 1 \ if you wantBa type: 2 \ n \ n";
cin >> opera_sum_or_subtra;

if (opera_sum_or_subtra == 1)
{

/// Question A

cout << "Enter the city of departure (remember that the maximum number is 4 and the minimum is 0" << endl;
cin >> city;

while (city <0 || city> 3) {
cout << "\ nVish will give no, as this city is not in the system :) \ n" << endl;

cout << "Enter the city of departure (remember that the maximum number is 4 and the minimum is 0" << endl;
cin >> city;
}
for (i = 0; i < size; i = i + 1)
if (city! = i)
{
if (l [i] [city] == 1) {by_d = by_d + 1; }
if (l [city] [i] == 1) {by_f = by_f + 1; }
}

cout << "there are" << by_f << "outgoing roads and" << by_d << "incoming roads"; }

/// Question B

else if (opera_sum_or_subtra == 2) {

cities = - 1;
counter_2 = - 1;

for (m = 0; m < size; m = m + 1) {

for (m = 0; m <size; i ++) {
counter = 0;

for (j = 0; j <size; j ++) {
if (l [j] [m] == 1) {
counter ++;
}
}
if (counter> counter_2) {
counter_2 = counter;
cities = m;
}
}}

cout << "The cities that have more outputs and entries are:" << cities << "with" << counter_2-1 << endl;

}
/// Question C

else if (opera_sum_or_subtra == 3) {

}
/// Question of

else if (opera_sum_or_subtra == 4) {

}
return 0;

}
please put code in code tags so it formats and highlights etc.

assuming you meant by_f ...
I see 2 issues.
your text says 0-4 is allowed.