Skip to main content

All Questions

Tagged with
1 vote
3 answers
127 views

How to make this while loop finish on new line

#include <stdio.h> int main() { int lista[9999]; int a; int i = 0; while (scanf(" %d", &a) == 1) { lista[i] = a; i++; } return 0; } I ...
Wow1345's user avatar
  • 77
-2 votes
2 answers
82 views

How to capture a variable from within a while loop/for loop [closed]

I'm making a little project just to practice arrays/loops. It's basically a bank page that you can sign up and log into. I want to be able to store the user inputs of their username and password into ...
beansies's user avatar
1 vote
1 answer
48 views

i am trying to get some sets of numbers let's say grades from the user. the code does not work since size gets changed to a random num in the loop

i am trying to get some sets of numbers let's say grades from the user. the code does not work since size gets changed to a random num in the loop. I dont understand why size gets a random value after ...
Danial Moghaddam's user avatar
-1 votes
3 answers
210 views

Why does my do-while loop exit after one iteration?

Beginner programmer here: I am trying to format a do while loop to work in a way that if the user inputs an incorrect number outside the range of 0-4, then my program should ask the user to input a ...
Summer's user avatar
  • 25
0 votes
0 answers
24 views

I want to fix my error which is shows as nullpoint exception error [duplicate]

public static void searchCustomer(){ Scanner input=new Scanner(System.in); L1:do{ clearConsole(); searchCustomerHomepage(); ...
Yasith's user avatar
  • 1
0 votes
0 answers
20 views

How can i use looping from 2 file txt?

I have 2 file .txt that i want to use for looping backup database. File 1 is database name = DB_NAME.txt db_abc db_def File 2 is table name = TB_NAME.txt tb_123 tb_456 tb_789 i want to use it to /...
skidamarink's user avatar
0 votes
2 answers
113 views

Why doesn't this array save the scanned numbers?

This is my code. It is supposed to scan numbers until 0 is entered. Then it should print the numbers. But all it prints is zero. #include <stdio.h> int main() { int x[100]; int n; ...
Coder's user avatar
  • 38
-1 votes
1 answer
41 views

How to properly form an array loop to use in an SQL statement

I am trying to use an array to pull table information. My array build seems to be fine and it is created with the correct number of rows. THis is what I have so far: DECLARE @myTableVariable TABLE (...
Lance Williams's user avatar
1 vote
2 answers
656 views

Keep adding numbers into an array until a = 0

Hi I'm new to javascript and I'm sorry if my question is silly for you. This question was solved with the following code: let arr = [12, 6, 53] let a do { a = prompt("Enter a number") a = ...
Soham's user avatar
  • 19
-1 votes
1 answer
111 views

Get all the members below me in an mlm module in PHP and MySQL

I have a database, as shown in this, any user can join with any sponsor ID, and they will get their own user ID which can lead the tree further. I want to get details of a particular user_id, say, '2'....
Saurabh's user avatar
-1 votes
2 answers
69 views

HOw to make a loop in all the array untill finish using js [duplicate]

i need to put all items that equals zero att the end of the array, i used a classic permutation code to do that, it works but it does not continu the comparison untill the end. function moveZeros(...
Madara uchi's user avatar
0 votes
1 answer
59 views

Rerun a function while a list still has elements

I think this may be a fairly trivial issue but I am still quite new to Node and Javascript. I have a list and a function as follows: var my_list = [1, 7, 9, 112, 15, 17, 19, 25, ...] // Main search ...
Tendekai Muchenje's user avatar
-1 votes
1 answer
15 views

Return unique values from one array into two different variables?

I'm trying to ensure that the "thing2" value is never equal to the "thing1", from values pulled from the same array. This is what I have come up with: const array = ["item1&...
Mitch A's user avatar
1 vote
2 answers
107 views

JavaScript - how can I create a function which can remove numbers from array?

I've tried this function removeFromArray(manyMoreArgs, number) { let i = 0; while (i < manyMoreArgs.length) { if (manyMoreArgs[i] === number) { manyMoreArgs.splice(i, 1); } ...
0xtrvkc's user avatar
  • 15
1 vote
3 answers
527 views

unshift and push inside a loop in Javascript, infinite loop javascript

I'm a beginner student and I'm try to get some information from "user" using the prompt() function, and then throw this information in an array. I need to use the loop FOR and the WHILE to ...
Júlio César Amorim's user avatar

15 30 50 per page
1
2 3 4 5
17