Q&A Discussies
Word counter
0 Stemmen
1 AntwoordHow this code can be re-writed?
0 Stemmen
1 AntwoordIn the continue Loop -
i = 0
while True:
i = i +1
if i == 2:
print("Skipping 2")
continue
if i == 5:
print("Breaking")
break
print(i)
print("Finished")
It shows the output being
"1
Skipping 2
3
4
Breaking
Finished"
Why are the last three lines not
"Breaking
5
Finished"
Where it shows print(i) after break?
1 Stem
3 AntwoordenGregorianCalendar
0 Stemmen
1 Antwoordpython
0 Stemmen
3 Antwoordenjavascript code
0 Stemmen
1 Antwoordin order to find the sum of n numbers given by user,suppose our program is to find the sum of any 4 numbers given by user (using while loop such that (while(i<=4))and incrementing each value of i by 1),if the user give any 2 inputs instead of four then the total sum should be the summation of that two inputs..but the program shows the sum something else,why it is so??
2 Stemmen
3 AntwoordenHow can I read from a file this line
19 34 Gateway Arch - St. Louis, MO.
The first digit is age, second timeUsed, and the rest description. So I want to read them and store them in a variable.
The code insime my while loop of my File is int age = reader.nextInt();
Int Tused = reader.nextInt();
Description = reader.next()
0 Stemmen
4 AntwoordenWhen Bongi's new baby, Sipho, was born,she opened a savings account woth R1000.00. On each daybitthday,starting with the first,the bank added 4.5% of the balnce and Bongi added another R500.00 to the account.Write a loop that will calculate how much money was in the account on Sipho's 18th birthday?
0 Stemmen
2 AntwoordenInstream & outstream
0 Stemmen
1 AntwoordHow do I do this?
-3 Stemmen
2 AntwoordenWrite a java program that generates the binomial coefficients for (x +y)^14 prints them, separated by a comma and a space use a loop or loops to increment the integer n and k after they are initialized.
Hint:for the above problem the coefficients ate the 15th row of pascal triangle
0 Stemmen
2 AntwoordenPrinting pattern with Javascript
0 Stemmen
1 AntwoordPointer in array
0 Stemmen
1 AntwoordNeed help with project python?
0 Stemmen
1 AntwoordIn the short code below, I declared an array of five elements. But I'm getting confused on how to use it in a while loop. My main question is , if the user inputs a userchoice1 value that is less than 1, I want the code to keep looping until the user inputs a number that is not less than 1. But I don't know if the 7th line (userchoice1 [x]++) shows the right way to loop it.
1 Stem
2 AntwoordenPopulair vandaag
Pointers cpp
3 Votes
Is pro worth the money ?
1 Votes
Coding for Cybersecurity
0 Votes
Pointers in c#
0 Votes
Drawing images in java
2 Votes