while-loop tag

27 questions


1 answers
145 views
0
Which is faster, while(1) or while(2)?

In the interview, I asked which one would be faster, while(1) or while(2)Whether it's (1) or (2), it's trueI said I think they'd be at the same speedwhile(1) is faster. Why?while(1) { //What code?}orw...

2 years ago

1 answers
82 views
0
I want to know the difference between for and while.

I'd like to know the difference between the JavaScript loop statement, why and for.

2 years ago

1 answers
180 views
0
Check while statement string comparison conditions

int main(void){ char* str[7] = { tiger, applemango, pear, anteater, strawberry, eagle, end }; char* st = malloc(sizeof(char)*4); while (*st != end) { printf (Search word (end) : ); scanf(%s, st); f...

2 years ago

1 answers
81 views
0
Python while moon

( elif num == 2: ^SyntaxError: invalid syntax) It pops up like this and there is a red mark on this part, so how do I solve it?money = 0 while True: num = int (input (select the menu :)) if num == 1:...

2 years ago

1 answers
69 views
0
I have a question about the Python snail arrangement

n=4m=3k = {}a=1b=0c=0while c< m*n: for i in range(abs(m)): b=b+1 c=c+1 k[(a,b)] = c if c==m*n: break for i in range(abs(n-1)): a=a+1 c=c+1 k[(a,b)] = c if c==m*n: break for i in range(abs...

2 years ago

2 answers
104 views
0
Sum of the number of digits using Python/while loop

Hello,Store an arbitrary number in a variable as an variableFind the sum of each digitIt's a problem of finding the sum of the numbers of digits that are greater than 2 and less than 8.(Arithmetic ope...

2 years ago

1 answers
114 views
0
c-language double-repeated statements

#include <stdio.h> void dice(int , int );int main(void){int input1, input2;scanf_s(%d%d, &input1, &input2);dice(input1, input2);return 0;}void dice(int num1, int num2){int a = 1, b = 1;w...

2 years ago

1 answers
96 views
0
I don't know why the c++ bingo game while statement can't end

When the user enters the (x, y) position on the 5x5 grid panel, 'O' is generated in that part, and I want to write a code that ends when it becomes a bingo.Declare int check = 0;while When it becomes ...

2 years ago

1 answers
89 views
0
I have a question about the triangular output and rhombus output using the Java scanner.

// Triangular scannerimport java.util.Scanner;public class Stars05 { public static void main(String[] args) { int line; Scanner input = new Scanner(System.in); System.out.print(How long is the line...

2 years ago

2 answers
97 views
0
To join a python list element to a certain rule

# Parsing matchalpha_list = [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]# After parsing alpha_list = [A, &, B, &, C, &, D, &&, E, &, F, &, G, &, H, &&, I, &...

« - 2 - »

© 2024 OneMinuteCode. All rights reserved.