All Questions

Tagged with
1
vote
2answers
52 views

Calculating and printing the sums of the diagonals of a matrix

This is a program that is supposed to calculate the sum of all the diagonals in the matrix and then print them out. ex. if the matrix is1 2 3 4 52 3 4 5 60 1 1 2 55 5 5 5 57 8 ...
1
vote
0answers
50 views

Java logic - strange things happening in while loop

In the while loop below I am finding some odd behavior with the output. I have spent a few hours looking over it but I'm confused as to why it returns the way it does.while (true) {...
0
votes
0answers
22 views

Checking a random Value against an Array to prevent duplicates

I am presently trying to write a script that would pull a random meal from a list of meals and input them in a calendar. It generates 4 weeks (Sunday through Saturday), with two different meals per ...
-1
votes
1answer
34 views

Looping multi-dimensional arrays in PHP 7.2

I've just upgraded to PHP 7.2 and I'm getting PHP Fatal error: Uncaught Error: Cannot use string offset as an array for the line $myarray[$ex][0]=$oldarray[$z]['ID']; in this old code......
0
votes
2answers
32 views

How can I print a 1D array to be 3 x 3 and how can I have an RNG computer check values and to keep searching for an empty space?

I have been working on a 1D Tic Tac Toe project for a while now, and I am still fairly new to coding, so I have a couple questions/issues.To start off, I am having issues with printing the board as ...
0
votes
2answers
91 views

How to “delete” every element in array by value in C

I have been trying to solve this problem for about 5 days..can't find any solution please send help. I am supposed to implement a function to "delete" every element in an array by value. Let's say my ...
2
votes
1answer
92 views

if inside a while loop causing trouble [closed]

I'm having trouble on the last part of my program.The code substracts an array p[j] with an input number nStevilo and then puts in into absolute. It then compares the result with a substraction of an ...
0
votes
2answers
21 views

Given an array of integers, find and increment duplicate values with the lowest sum of total array in Python?

Given an array, arr, we want it to make it unique by incrementing any duplicate elements in arr such that the sum of arr unique's elements is minimal. In other words, if two or more elements in arr ...
-1
votes
0answers
31 views

How can I make a while loop with a conditional statement in assembly?

Hello so I've been working on this homework where we have to convert:int array[]={1, 87, 19, 9, 21, 65, 3, 78, 190};int max=0;int SizeArray=sizeof array / sizeof max;int index=0;...
-3
votes
0answers
22 views

problem with endwhile statement using PHP array sorting [duplicate]

I'm having this small issue and I don't know how to fix it.The Erro is : Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result,boolean given in C:(address).When I replaced ...
0
votes
2answers
50 views

Arrays not averaging out correctly using a loop

namespace Files_and_Arrays_II{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button3_Click(object ...
0
votes
1answer
36 views

php loop array through separate array's while loop

I've been searching for this for about 2 hours and haven't found anything that specifically matches what I'm trying to do. It might not be possible, but I consider myself basic with php.I have a php ...
0
votes
0answers
31 views

Code decreases value of number if next to a 0 in an array. When i place a 0 in the first place in the array the program doesn't work

Attempting to decrease the value of a number in an array if next to a certain value.I’m trying to fix an error in my code where it won’t properly decrease numbers in my array if they are next to the ...
-2
votes
1answer
81 views

Sum of 100 digit numbers

I have two arrays each containing 100 digits.I need to add corresponding digits from units place meaning from the end of the array.If there is a carry it should be added in the next index.It should ...
0
votes
2answers
55 views

average is outputting as inf

I am trying to calculate the average for a class from scores given using a data file that was given.The formula I'm using is grade_Average=sum / i;The data file that was given is :Joe Johnson ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,